Xml reading/parsing problems

I am attempting to setup values in an application with information from an xml file. Some of the values are strings. I have replaced the & symbol with & but the strings seem to be getting cut off. Should I be doing it this way or should I update my app server in some way?

Here is my code...sorry that its so long :(There is no problem if the code is long. But atleast it should be formatted to help us read it.
Node child = ((Node) pastNodes.get(pastNodes.size()-
1)).getFirstChild();
          //*** NULL POINTER HERE
//System.out.println(child.getNodeName()+"
deName()+" / "+child.getNodeType());I think you get the NullPointerException when you call a method on the child node. The getFirstChild() method could return null if there is no child node. It is always good to check for nulls.

Similar Messages

  • XML Tree Parsing problems

    I am trying to make a program that will read the tree of an xml file and later store the data in a different format...
    At the moment it reads part of the tree. but then a null pointer exception occurs on the line marked (***) in the .java file attached.
    It starts at the base element ('servers' in this case) then finds if it has child nodes, if so it stores them, again and again untill it finds text, it will then print the text to screen, and remove the child from the previous node. If a node no longer has any children it is removed from the list and then the next node is found...
    The problem being is that is isnt correctly working, as some of the nodes in the pastNodes arraylist are being replaced by one of their child nodes....so when it comes to the point where the list gets shorter and the next node needs to be found it has an incorrect tree list in pastNodes and dies on me.
    The reason for doing it like this is so that i can list the values in a tree like format in an array (eventually) such as 'servers.server.ComputerName' has value 'Bobs_PC' etc. as the program that wrote this leaves multiple smae named variables with different types of value...e.g. like 100 'Name' tags but some refer to a drive name and others to services names.
    Any ideas?
    Cheers for any help.
    Here is my code...sorry that its so long :(
    public void read(String xmlToRead){
              System.out.print("\n* Reading '"+xmlToRead+"'...");
              try {
         DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
         Document doc = docBuilder.parse(new File(xmlToRead));
         // normalize text representation
         doc.getDocumentElement ().normalize ();
         NodeList listOfNodes = doc.getElementsByTagName("servers");
         ArrayList pastNodes= new ArrayList();
         pastNodes.add(listOfNodes.item(0));
         while(((Node) pastNodes.get(pastNodes.size()-1)).hasChildNodes()){
              System.out.println("\n------");
              //stores all new nodes with children
              if(((Node) pastNodes.get(pastNodes.size()-1)).getFirstChild().getNodeName() != "#text"){
                   pastNodes.add(((Node) pastNodes.get(pastNodes.size()-1)).getFirstChild());
                   System.out.println("NODE ADDED");
              System.out.println("pastNodes Path:");
              int x=0;
              while(x<pastNodes.size()){
                   System.out.println(x+": "+((Node) pastNodes.get(x)).getNodeName());
                   x++;
                   //print the text value
              Node child = ((Node) pastNodes.get(pastNodes.size()-1)).getFirstChild();
              //*** NULL POINTER HERE
              //System.out.println(child.getNodeName()+" / "+child.getNodeType());
              if(child != null && child.getNodeName()=="#text"){System.out.println("Value: "+child.getNodeValue());}
              //remove child node from parent once read
              if(((Node) pastNodes.get(pastNodes.size()-1)).hasChildNodes()){
                   Node newNode = ((Node) pastNodes.get(pastNodes.size()-1)).removeChild(child);
                   pastNodes.remove(pastNodes.size()-1);
                   System.out.println("Child Removed: "+child.getNodeName());
                   pastNodes.add(newNode);
                   //deletes a node from list if it does not have any more children.
                   if(!((Node) pastNodes.get(pastNodes.size()-1)).hasChildNodes()){
                        System.out.println("Removed Past Node : "+(pastNodes.size()-1)+"/"+((Node) pastNodes.get(pastNodes.size()-1)).getNodeName());
                        pastNodes.remove(pastNodes.size()-1);
         System.out.println(((Node) pastNodes.get(pastNodes.size()-1)).hasChildNodes());
         }catch (SAXParseException err) {
         System.out.println ("** Parsing error" + ", line " + err.getLineNumber () + ", uri " + err.getSystemId ());
         System.out.println(" " + err.getMessage ());
         }catch (SAXException e) {
         Exception x = e.getException ();
         ((x == null) ? e : x).printStackTrace ();
         }catch (Throwable t) {
         t.printStackTrace ();
              System.out.print("Done\n");
    ** And a snippet of the output at the console

    Here is my code...sorry that its so long :(There is no problem if the code is long. But atleast it should be formatted to help us read it.
    Node child = ((Node) pastNodes.get(pastNodes.size()-
    1)).getFirstChild();
              //*** NULL POINTER HERE
    //System.out.println(child.getNodeName()+"
    deName()+" / "+child.getNodeType());I think you get the NullPointerException when you call a method on the child node. The getFirstChild() method could return null if there is no child node. It is always good to check for nulls.

  • WIJ 20002 xml Parser Problem - Rich Client

    Hi,
    I have a problem with the rich client on a new installation:
    Business Objects Enterprise XI 3.1 SP3 on Windows 2008 Standard.
    If I connect with the rich client "import document"is disabled.
    if I try to create a new document from the rich client it returns the error below (I used the rich client on two workstations):
    WIJ 20002
    Version: null
    Analisi dello stack:
    java.lang.RuntimeException: java.lang.RuntimeException: XML parser problem:
    XMLJaxpParser.parse(): Element type "ABOUT_Patentnumbers" must be followed by either attribute specification, ">" or "/>".
    at com.businessobjects.wp.xml.jaxp.XMLJaxpParser.parse (Unknown Source)
    at.com.businessobjects.webi.richclient.XMLviaOccaRC.getServerConfiguration (Unknown Source)
    Have you any solution?

    The fixpack 3.5 client resolves the problem.

  • Xml and PL/SQL Parser problem.........

    While executing the sample procedure for XML/PLSQL Parser it gives the error:
    ERROR at line 1:
    ORA-29541: class SCOTT.oracle/xml/parser/plsql/XMLParserCover could not be resolved
    ORA-06512: at "SCOTT.XMLPARSERCOVER", line 0
    ORA-06512: at "SCOTT.XMLPARSER", line 57
    ORA-06512: at "SCOTT.DOMSAMPLE", line 57
    ORA-06512: at line 1
    While loading the xmlparserv2.jar by using Loadjava I got the resolving problem for some class.
    Wht should i do to rectify this error?
    Thanks And Regards
    Suresh
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    SELECT TEXT FROM USER_ERRORS
    WHERE NAME = DBMS_JAVA.SHORTNAME('oracle/xml/parser/plsql/XMLParserCover')
    to see what error is preventing this class from being resolved...<HR></BLOCKQUOTE>
    ========================
    Hello.
    I have exactly the same problem and the above SQL does not return any rows.
    I upgraded my 8.1.5 on NT to 8.1.6. On trying to install the PL/SQL XML parser, received errors with resolving classes. Suspecting problems with Java VM, I re-installed the JVM using initjvm.sql. On successfull completion, i re-tried installing the parser. Still have the same problems.
    Is there anything else i could try?
    regards
    Krishnan.
    null

  • UTF-8, Unicode, XML and windows problems

    Hi there,
    I'm developing an application which uses a lot of russian text.
    This russian text is stored in XML and can be sent to a server remotly
    I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.
    The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string.
    So when I generate xml and print it out I get something that looks like the following:
    ��������� ������������ ���������?����Thats ok, beacause I can stick that streight into a file when writing files and it works.
    But the problem comes when sending the XML over the server.
    The sending implentation I use must be able to send java generated utf-16 and xml read utf-8.
    So I convert the XML from utf-8 to utf-16, using the following:
    byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
    utf8String = new String(stringBytesISO, "UTF-8");And that works perfectly on my linux system.
    However when I run it on windows, it only seems to convert some of the characters
    &#1055;&#1088;&#1080;&#1074;&#1099;&#1095;&#1085;&#1099;&#1084; &#65533;?&#1085;&#1086;&#1084; &#1079;&#1072;&#65533;?&#1085;&#1091;&#1090; &#1076;&#1086;&#1088;&#1086;&#1075;&#1080; &#1076;&#1086; &#1074;&#1077;&#65533;?&#1085;&#1099;,Does anyone know whats going wrong here?

    jammers1987 wrote:
    I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.DbUnit is a testing tool; are you saying you're using it in a production system? Ideally, you should use the same library to write the XML as you do to read it, but you definitely shouldn't be using DbUnit in this context.
    The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string. That should never happen. XML is just text, and text can either be in the form of a Java string, or it can be stored externally using a text encoding like UTF-8. Never mind that Java strings use the UTF-16 encoding; you don't need to know or mention that. Encodings only come into play when you're communicating with something outside your program, like a file system or a database.
    When you generate the XML, you specify that the encoding is UTF-8. When you read the XML, you specify that the encoding is UTF-8. That's all.

  • SAX parser problem in JDK1.5

    I have parse the xml file using SAX in jdk1.5 environment. During the parsing, it missed the some text content.
    for example
    <employeeid>
    <empid>1001</empid>
    <empid>1002</empid>
    </employeeid>
    If i have parse the above xml file using SAX in jdk1.5 environment. The output is
    1001
    100
    during the parsing , SAX parser misses digit of 2.
    if i have parse the above xml file using SAX in jdk1.4 environment , it is working fine.
    what is the problem in jdk1.5
    please help
    bala

    What I expect the problem to be was discussed recently in a topic titled "SAX Parser Problems" that was started on March 14 at 6:59 AM by JackoBS.
    Read that and see if it fixes your problem. If so, it is not a JDK1.5 problem, but a user error.
    Dave Patterson

  • XML C++ Parser in Solaris 2.6 could not parse with base64

    I am using XML C++ Parser (version 2.0.4) in Solaris 2.6
    I am using the following definition in dtd file to process binary data.
    <!ELEMENT Agent (base64)>
    I have two problem from xmlparse() function.
    1. This declaration always produces a warning:
    LPX-00103: warning: document structure does not match DTD.
    2. This causes the parser to fail completely if the corresponding data is empty. This field needs to be optional.
    Any ideas how to handle this situation.
    Thanks in advance
    Vijay Kumar

    You can either turn off validation or read section 3.2 of http://www.w3.org/TR/1998/REC-xml-19980210 on how to write a proper DTD.
    null

  • Parser problem, maybe??

    I am new to SAX with Java. I am using Window XP and I have downloaded Java 2 (sdk1.4.2_01) and to run with SAX, I also downloaded the Java Web Services Package (jwsdp-1.3), which will allow me to run DOM and SAX. However, I still can't get my program run well. It keeps telling me that the "Package com.jclark.xml.sax does not exists". I think it might be the parser is not correct? Maybe I should use Sun's parser since I downloaded the web services packages from Sun? It just a simple program, but I am stack on the package does not exists problem ... help!!! :(
    My code as follow:-
    ========================================================
    * Write a description of class hello here.
    * @author (your name)
    * @version (a version number or a date)
    import org.xml.sax.*;
    public class BookCounter extends HandlerBase
    public static void main (String args[]) throws Exception
    (new BookCounter()).countBooks();
    public void countBooks() throws Exception
    Parser p = new com.jclark.xml.sax.Driver();
    p.setDocumentHandler(this);
    p.parse("file:///C:/books.xml");
    ========================================================

    I have downloaded the Java WSDP 1.3 and I also saw that there is a folder called 'jaxp' which has 'lib' folder that contains a 'jaxp-api' Executable Jar File. Isn't that all I need to get my program run? Or I need to implement OR set some setting OR import something in my program before I can run my simple program? My code as follow:-
    =============================================
    * Write a description of class hello here.
    * @author (your name)
    * @version (a version number or a date)
    import org.xml.sax.*;
    public class BookCounter extends HandlerBase
    public static void main (String args[]) throws Exception
    (new BookCounter()).countBooks();
    public void countBooks() throws Exception
    //Parser p = SAXParserFactory.newSAXParser();
    Parser p = new com.jclark.xml.sax.Driver();
    p.setDocumentHandler(this);
    p.parse("file:///C:/books.xml");

  • XML read errors--failure to open dtd (DITA)

    Hi all,
    I've run out of ideas and places to look on this one, I hope someone can help.
    The specs: WinXP Pro, Frame 8.0p277. Built-in DITA. Not using DITA Open Toolkit. No major issues except for previously discussed conref problems which, many thanks to Scott, seem to be under control.
    The context: I'm a freelancer, on contract to a financial institution. I work part-time in my own office (up-to-date, preferred set-up) and part-time onsite. I can't go into detail, but the set-up is less than ideal. I have to do much back-and-forth portaging of project and template files, and they are often corrupted when I reopen them.
    Specs onsite I'm not sure about, but it's definitely Frame 8 with the first patch. I'm pretty sure they haven't installed any others, so the 8.03 patch shouldn't be an issue. (I'll check and report back, if that info is needed.)
    The error: Came out of the blue last week, my first day back in my office after three days onsite. Now, every time I open or create any xml file, using any template, I get an XML Read Report Log error that reports a failure to open the DTD, and a parse error in the document prolog. I don't know where it's coming from, and I don't know why it started happening. I modified structapps once, many months ago, but hadn't touched it since, and I've never touched the r/w rules files in either location.
    (I realize I should test this scenario onsite, but I daren't risk importing trouble, if it started here.)
    Specifically, the error reads: Could not open DTD file: C:\Documents and Settings\path-to-project-files-folder\ditabase.dtd Parse error at line 9, char 1: Error procssing external entity reference.
    I don't understand why it's looking for the dtd file in the same folder as the project files when I've never stored it there, and I have the following in the structapps, and r/w rules files.
    DTD: $STRUCTDIR\xml\dita\default-app\dtd\ditabase.dtd
    Read/write rules: $STRUCTDIR\xml\dita\default-app\DITA-Topic-FM\topic.rules.txt
    The R/W Rules statement reads: writer external dtd is public "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd";
    I can go completely cross-eyed after a few hours trying to parse these docs myself. The answer may well be right in front of me, but for the life of me I can't see it. I hope someone else can.
    Karen

    Hello Karen,
    Have you been able to resolve this issue? I'm encountering a similar issue while going through the FrameMaker 8 Help topics: Processing XML > Migration from Unstructured FrameMaker to XML > Getting started with structure.
    I have followed along with all the examples all the way down to the "Testing XML round-tripping" topic. When I go to the step: Export the FrameMaker file to XML, and select my XML application, I get a parsing error similar to what you had mentioned above.
    The Help topics have you first build an EDD for a simple document (proposal) - successful.
    They then have you open a new document and import the EDD - successful.
    They then have you add formatting to the EDD and then reimport into your document to test it. - successful
    They then have you build the structured app by saving the EDD to DTD. You are then supposed to create a template by removing all the content from your original file that they had you open and save it as a template. Then you are supposed to edit the application definition file. Finally you copy the template and the DTD to the Adobe FrameMaker 8 folder. - successful
    I've done this process twice and each time I get the same Save to XML Log error message when trying to export my document to XML.
    The first things that are displayed are the path the source and destination folders.
    Next is the XML parser error messages (Document Prolog).
    There are basically 2 parsing errors, line 3 and 9.
    line 3, "Could not open DTD file" C:\DOCUME~1\MICHAE~1\LOCALS~1\Temp\$STRUCTDIR\XML\Preface\Preface.dtd
    Error in processing external entity reference"
    line 9, "Could not open DTD file" C:/Documents%20and%20Settings/michael_randall/My%20Documents/FrameEDDTemplatePractice/$ST RUCTDIR/XML/Preface/Preface.dtd
    Error in processing external entity reference"
    Please let me know if have any new information.
    Thanks,
    Michael Randall

  • Trying to use XML SAX parser with JDK2 ...

    Hi,
    I'm pretty new to Java.
    I'm trying to write and use java sample using XML SAX parser. I try with XP and XML4J.
    Each time I compile it give me a error message like
    "SAX01.java:23: unreported exception java.lang.Exception; must be caught or declared to be
    thrown
    (new SAX01()).countBooks();
    ^
    Note: SAX01.java uses or overrides a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error"
    For what I found, it seems that "deprecated" mean usage of old classes or methods. What should I do ?
    Wait for the XML parser to be rewrite ? ....
    Thank's
    Constant

    "SAX01.java:23: unreported exception
    java.lang.Exception; must be caught or declared to be
    thrown
    (new SAX01()).countBooks();
    ^Do this
    public static void main(String[] args) throws Exception {
    or do this
         try
                       first part of expression?(new SAX0()).countBooks();
         catch(Exception ex)     
              System.out.println("problem "+ ex);
    Note: SAX01.java uses or overrides a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error"deprecation is just a warning if there are no errors elsewhere in your program it should compile fine, but if you want to find out how to change it do this:
    javac YourClassName.java -deprecation
    then look in the docs for an alternative.

  • XML SAX parser that support  LexicalHandler

    Hello,
    I'm looking for an XML SAX parser that support a LexicalHandler.
    I have xml files that are not well formed, ie: (&, <, >, etc...) characters within tags and I need to ignore them.
    Anyone have a link to some opensource library ??
    Thanks,
    Samir

    Don't waste your time. Using a LexicalHandler isn't going to help with parsing malformed XML. You should get the person who produced those files to replace them with correct XML.
    PC&#178;

  • Using XDKs XML Schema Parser

    I want to parse an XML schema(XSD file) and extract the types from it, ComplexType etc. Does anyone know to even begin this. Ive managed to parse and any XML file sucessfully returning all element types,names and values using the DOM parser but cant seem to find suitable methods in the oracle.xml.parser.schema library. I have started along these lines
    XSDBuilder bob =new XSDBuilder();
    XMLSchema sch = (XMLSchema)bob.build(url);
    where URL is string referencing the xsd file. But after that all I can get is the targetnamespace using
    String display = sch.getSchemaTargetNS();
    Any help greatly appreciated.

    Srinivas,
    Thanks for the reply. But that is not my requirement.Suppose I have a schema representing the following xml
    <Student>
    <Name>ABC</Name>
    <Class>XYZ</Class>
    <Course>PQR</Course>
    </Student>
    When I parse the XML Schema representing the above XML, it should give me a Java object that represents this XML structure. (Similar to Document object that is obtained when we an XML is parsed)
    Hope this is more clear.

  • Xml schema validation problem

    Hi All
    How to tackle this xml schema validation problem
    i am using the sample code provided by ORacle technet for xml
    schema validation in the Oracle database(817).
    The sample code works perfectly fine.
    Sample as provided by http://otn.oracle.com/tech/xml/xdk_sample/archive/xdksample_093001.zip.
    It works fine for normal xml files validated against
    xml schema (xsd)
    but in this case my validation is failing . Can you let me know why
    I have this main schema
    Comany.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.company.org"
    xmlns="http://www.company.org"
    elementFormDefault="qualified">
    <xsd:include schemaLocation="Person.xsd"/>
    <xsd:include schemaLocation="Product.xsd"/>
    <xsd:element name="Company">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Person" type="PersonType" maxOccurs="unbounded"/>
    <xsd:element name="Product" type="ProductType" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    ================
    which includes the following 2 schemas
    Product.xsd
    ============
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="Type" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    ==============
    Person.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="PersonType">
    <xsd:sequence>
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="SSN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    =================
    now when i try to validate a xml file against Company.xsd
    it throws an error saying unable to find Person.xsd.
    no protocol error
    Now where do i place these 2 schemas(.xsd files) Person & product
    so that the java schemavalidation program running inside Oracle
    database can locate these files
    Rgrds
    Sushant

    Hi Jinyu
    This is the java code loaded in the database using loadjava called by a wrapper oracle stored procedure
    import oracle.xml.parser.schema.*;
    import oracle.xml.parser.v2.*;
    import java.net.*;
    import java.io.*;
    import org.w3c.dom.*;
    import java.util.*;
    import oracle.sql.CHAR;
    import java.sql.SQLException;
    public class SchemaUtil
    public static String validation(CHAR xml, CHAR xsd)
    throws Exception
    //Build Schema Object
    XSDBuilder builder = new XSDBuilder();
    byte [] docbytes = xsd.getBytes();
    ByteArrayInputStream in = new ByteArrayInputStream(docbytes);
    XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
    //Parse the input XML document with Schema Validation
    docbytes = xml.getBytes();
    in = new ByteArrayInputStream(docbytes);
    DOMParser dp = new DOMParser();
    // Set Schema Object for Validation
    dp.setXMLSchema(schemadoc);
    dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    dp.setPreserveWhitespace (true);
    StringWriter sw = new StringWriter();
    dp.setErrorStream (new PrintWriter(sw));
    try
    dp.parse (in);
    sw.write("The input XML parsed without errors.\n");
    catch (XMLParseException pe)
    sw.write("Parser Exception: " + pe.getMessage());
    catch (Exception e)
    sw.write("NonParserException: " + e.getMessage());
    return sw.toString();
    This is the code i used initially for validating a xml file against single xml schema (.xsd) file
    In the above code could u tell how to specify the second schema validation code for the incoming xml.
    say i create another Schemadoc for the 2nd xml schema.
    something like this with another parameter(CHAR xsd1) passing to the method
    byte [] docbytes1 = xsd1.getBytes();
    ByteArrayInputStream in1 = new ByteArrayInputStream(docbytes1);
    XMLSchema schemadoc1 = (XMLSchema)builder.build(in1,null);
    DOMParser dp = new DOMParser();
    How to set for the 2nd xml schema validation in the above code or can i combine 2 xml schemas.
    How to go about it
    Rgrds
    Sushant

  • XML C++ Parser in Solaris 2.6 could not parse with encoding UTF-16

    I tried to use UTF-16 encoding in the XML C++ Parser in Solaris 2.6.
    xmlinit() fails and returns error 201 - i.e.Unknown encoding. Though the ORACLE documentation has many encodings including UTF-16. Quite a few of these encodings are not working.
    Can any one help about UTF-16.
    Thanks
    Vijay Kumar

    Do you have Oracle's NLS data files?

  • Sax parser problem plz help

    hi !!!!!!!!!!!!
    Im using a SAX parser to parse an xml file im successful in doing it i got tit parse after parising i want the value of a particular tag for example i have a tag as
    <filtername>datasource</filtername>
    i want datasource after parsing the xml and without using DOM concept how do i do it please help

    hi i have a parser for start parsing and for start element
    when im doing this i get the complete xml parsed after the xml is parsed how do i get it i still could not get how to soak the characters .....
    private void startParsing()
              try
                   InputStream instream = getClass().getClassLoader().getResourceAsStream(contextFile);
                   InputSource in = new InputSource(instream);
                   SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
                   XMLReader reader = parser.getXMLReader();
                   reader.setContentHandler(this);
                   reader.parse(in);
              catch(ParserConfigurationException pce)
                   System.out.println(pce);
              catch(SAXException se)
                   System.out.println(se);
              catch(IOException ie)
                   System.out.println(ie);
         public void startElement(String uri,String localName,String qName,Attributes attributes)
              System.out.format("uri : %s localName %s qName %s %n",uri,localName,qName);
    so now i have an attribut but i need content of the opening and closingtag like
    attribute is name
    <name>jack</name>
    im successfull in getting name but now i want jill ....

Maybe you are looking for