D
duduch_1er
Hello i tried this code in my stylesheet :
xsl:variable name="items"
select="xsl-usexsl:getElementsBySplitString(.,'i')" />
whith the java function getElementsBySplitString
here the code :
public static Element getElementsBySplitString(String aToSplit, String
aSeparator) throws UseXslException {
// Declaration
int intFound = 0;
// Trace
Log.debug(Constantes.CLE_METIER, mClassName,
"getElementsBySplitString : DEBUT");
try {
Element items= new Element("ITEMS");
if (aToSplit != null) {
intFound = aToSplit.indexOf(aSeparator);
while (intFound != -1) {
Element item = new Element("ITEM",aToSplit.substring(0,
intFound));
items.addContent(item);
aToSplit = aToSplit.substring(intFound + 1);
intFound = aToSplit.indexOf(aSeparator);
}
if (aToSplit.length() > 0){
Element item = new Element("ITEM",aToSplit);
items.addContent(item);
}
}
// Trace
Log.debug(Constantes.CLE_METIER, mClassName,
"getElementsBySplitString : FIN");
return items;
} catch (Exception MyE) {
// Signalisation
Log.erreur(Constantes.CLE_METIER, "split : " + MyE.getMessage());
// Propagation
throw new UseXslException("Impossible de formater une chaine de
caractere en un Node");
}
}
and i get the following error :
org/apache/xpath/objects/XObject incompatible with
org/apache/xpath/objects/XNodeSet
Has someone anyidea for resolve this problem ?
thanks
xsl:variable name="items"
select="xsl-usexsl:getElementsBySplitString(.,'i')" />
whith the java function getElementsBySplitString
here the code :
public static Element getElementsBySplitString(String aToSplit, String
aSeparator) throws UseXslException {
// Declaration
int intFound = 0;
// Trace
Log.debug(Constantes.CLE_METIER, mClassName,
"getElementsBySplitString : DEBUT");
try {
Element items= new Element("ITEMS");
if (aToSplit != null) {
intFound = aToSplit.indexOf(aSeparator);
while (intFound != -1) {
Element item = new Element("ITEM",aToSplit.substring(0,
intFound));
items.addContent(item);
aToSplit = aToSplit.substring(intFound + 1);
intFound = aToSplit.indexOf(aSeparator);
}
if (aToSplit.length() > 0){
Element item = new Element("ITEM",aToSplit);
items.addContent(item);
}
}
// Trace
Log.debug(Constantes.CLE_METIER, mClassName,
"getElementsBySplitString : FIN");
return items;
} catch (Exception MyE) {
// Signalisation
Log.erreur(Constantes.CLE_METIER, "split : " + MyE.getMessage());
// Propagation
throw new UseXslException("Impossible de formater une chaine de
caractere en un Node");
}
}
and i get the following error :
org/apache/xpath/objects/XObject incompatible with
org/apache/xpath/objects/XNodeSet
Has someone anyidea for resolve this problem ?
thanks