Hallo!
I’ve a big (for me) problem!!1
i’ve this function:
public Vector SearchCitationByEE(String ee) throws DAOException{
if(dataSource.chkConnection()) {
dataSource=new DataSource();
}
Vector res = new Vector();
Vector Vapp = new Vector();
String q = "for $q in input()/EnvironmentEffect where $q/EnvironmentEffectName = '"+ee+"' return $q";
TXQuery query = TXQuery.newInstance(q);
TXMLObjectAccessor xmlObjectAccessor = dataSource.getTXMLObjectAccessor();
try {
TResponse response = xmlObjectAccessor.xquery( query );
TDOMElementIterator iterator = new TDOMElementIterator(response.getXMLObjectIterator());
TXMLObject xmlObject = TXMLObject.newInstance(TDOMObjectModel.getInstance());
org.w3c.dom.Node app;
org.w3c.dom.Element Eapp;
org.w3c.dom.NodeList appList;
if (!iterator.hasNext()) {
System.out.println( "no documents!" );
} else {
while (iterator.hasNext()) {
while (iterator.hasNext()) {
Eapp = iterator.next(); //Prendo l'elemento
appList = Eapp.getElementsByTagName("AuthorName");
for(int k=0;k<appList.getLength();k++) {
app = appList.item(k);
app = app.getFirstChild();
Vapp.add(app.getNodeValue()); //AuthorName
}
appList = Eapp.getElementsByTagName("BookTitle");
for(int k=0;k<appList.getLength();k++) {
app = appList.item(k);
app = app.getFirstChild();
Vapp.add(app.getNodeValue()); //BookTitle
}
appList = Eapp.getElementsByTagName("Volume");
for(int k=0;k<appList.getLength();k++) {
app = appList.item(k);
app = app.getFirstChild();
Vapp.add(app.getNodeValue()); //Volume
}
appList = Eapp.getElementsByTagName("Chapter_Verse_Line");
for(int k=0;k<appList.getLength();k++) {
app = appList.item(k);
app = app.getFirstChild();
Vapp.add(app.getNodeValue()); //CVL
}
res.add(Vapp);
Vapp = new Vector();
}
}
}
}
catch (TException insertException) {
System.out.println( "XQuery failed!" );
System.out.println( insertException );
}
return res;
}
If i try to call it from a servlet it give me no document!!!
From a normal java class i’ve no problem!!!
I’ve inserted a “System.out” call to see the value of the param…and it’s correct in both cases!!
To change it’s only the result!!! empty only with the servlet!
This function it’a in a class called “Search”.
pls help me!
tnx
Luca