Results 1 to 5 of 5
  1. #1
    Anandhi12345 is offline Member
    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Default Problem with SAX parser

    I have a problem with SAX parser.

    My code contains the text in this format

    <edge label="GENE1 (int) GENE2" source="-1" target="-4199">
    <att type="integer" name="protein1" value="12"/>
    <att type="integer" name="protein2" value="11"/>
    <att type="integer" name="protein3" value="10"/>
    Now both the types "edge" and "att" have been called as qualified names. I would like to know how to access the second qName ("att") inside the first qName (edge). Please help!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Problem with SAX parser

    Removed from JPA and Sax parser persistence issue

    Don't hijack another poster's thread.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Problem with SAX parser

    Also, don't double post. Your other thread hijack post has been deleted.

    Please go through the Forum Rules.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    alexandra12 is offline Member
    Join Date
    Jul 2011
    Posts
    34
    Rep Power
    0

    Default Re: Problem with SAX parser

    Something like the below !


    private boolean edge=false;

    public void start element(){
    if(qname.equalsIgnorecase("edge"){
    edge=true
    }

    }

    public void endElement(){
    if(edge){
    if(qName.equalsIgnoreCase("edge"){

    //put your code here

    }
    }

    edge=false
    }


    Also one to note that all attributes are only called in the start element and not in the end element

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Problem with SAX parser

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. xml parser
    By kkGG in forum Advanced Java
    Replies: 7
    Last Post: 01-25-2012, 10:46 AM
  2. XML Parser SAX problem with diacritical letters
    By damiannelus in forum New To Java
    Replies: 1
    Last Post: 12-10-2010, 02:13 PM
  3. xml parser problem
    By raghavendra.cse in forum Advanced Java
    Replies: 1
    Last Post: 05-13-2010, 05:01 PM
  4. Problem with HTML parser
    By kpraveenreddy in forum New To Java
    Replies: 0
    Last Post: 03-02-2010, 03:12 PM
  5. problem with XERCES Parser using Option FieldType
    By oregon in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 02:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •