Fix XALANJ-2546 xsl:sort lang attribute ignores parameter value, only hard-coding works.
git-svn-id: https://svn.apache.org/repos/asf/xalan/java/trunk@1348522 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/org/apache/xalan/xsltc/compiler/Sort.java b/src/org/apache/xalan/xsltc/compiler/Sort.java
index 5ff8752..4213f1a 100644
--- a/src/org/apache/xalan/xsltc/compiler/Sort.java
+++ b/src/org/apache/xalan/xsltc/compiler/Sort.java
@@ -67,11 +67,10 @@
private AttributeValue _order;
private AttributeValue _caseOrder;
private AttributeValue _dataType;
- private String _lang; // bug! see 26869
+ private AttributeValue _lang; // bug! see 26869, see XALANJ-2546
private String _data = null;
-
private String _className = null;
private ArrayList _closureVars = null;
private boolean _needsSortRecordFactory = false;
@@ -158,10 +157,9 @@
}
_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("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);
@@ -183,6 +181,7 @@
_order.typeCheck(stable);
_caseOrder.typeCheck(stable);
_dataType.typeCheck(stable);
+ _lang.typeCheck(stable);
return Type.Void;
}
@@ -207,9 +206,7 @@
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
+ _lang.translate(classGen, methodGen);
}
/**