View Single Post
Old 02-19-2009, 06:10 AM   #4 (permalink)
hibbert
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, this is what i have got (so far)
PHP Code:
public class frmXML extends UiApplication{
    
MainScreen mainScreen null;
        
    private final class 
myScreen extends MainScreen {}
     
    public static 
void main(Stringxxx91;xxx93; args) {
        
frmXML theApp = new frmXML();
        
theApp.enterEventDispatcher();
    }
    
    private 
InputStream stringToStream(String _text) {
        
InputStream is = new ByteArrayInputStream(_text.getBytes("UTF-8"));
        return 
is;
    }
        

    public 
frmXML() {
        final 
MainScreen mainScreen = new myScreen();
        
SAXParserFactory factory SAXParserFactory.newInstance();
        
OutputStreamWriter out;      
        
String xmlString "<data><user><name>Name1</name><vorname>Vorname1</vorname></user><user><name>Name2</name><vorname>Vorname2</vorname></user></data>";
  try {

        
out = new OutputStreamWriter(System.out"UTF8");
        
SAXParser saxParser factory.newSAXParser();
        
saxParser.parse(new InputSource(stringToStream(xmlString), new clsUser()));
    } catch (
Throwable err) {
        
err.printStackTrace ();
  }
}
}
//========================================
package XML;

class 
clsUser 
    public 
String Name "";
    public 
String Vorname "";
    
clsUser() {}

but i get this error here:
Quote:
cannot find symbol
symbol : constructor InputSource(java.io.InputStream,XML.clsUser)
location: class org.xml.sax.InputSource
saxParser.parse(new InputSource(stringToStream(xmlString), new clsUser()));
^ (under new InputSource)
1 error
maybe someone can help me, and how do i create my vector??

thanks hibbert
__________________
My English is so bad, that makes me nobody so quickly after
Offline   Reply With Quote