Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get value of a particular xml tag having same names and no attribute while parsing xml in sax parser
    primarykey
    data
    text
    <p>Actually i was trying to get value of only one particular node but the node tag is at many places in the xml document. here is xml snippet</p> <pre><code>&lt;t:Address xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"&gt;&lt;t:Name&gt;XYZ Conference Rooms&lt;/t:Name&gt;&lt;t:EmailAddress&gt;XYZConferenceRooms@abc.co.in&lt;/t:EmailAddress&gt;&lt;t:RoutingType&gt;SMTP&lt;/t:RoutingType&gt;&lt;t:MailboxType&gt;PublicDL&lt;/t:MailboxType&gt;&lt;/t:Address&gt;&lt;t:Address xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"&gt;&lt;t:Name&gt;ABC Conference Rooms&lt;/t:Name&gt;&lt;t:EmailAddress&gt;ABCConferenceRooms@abc.co.in&lt;/t:EmailAddress&gt;&lt;t:RoutingType&gt;SMTP&lt;/t:RoutingType&gt;&lt;t:MailboxType&gt;PublicDL&lt;/t:MailboxType&gt;&lt;/t:Address&gt; </code></pre> <p>The thing is i only want value (ABCConferenceRooms@abc.co.in) from the above xml. The above is just a code snippet we have 10 values of email address in xml.</p> <p>While i am doing this in my parser </p> <pre><code> String value; String url; String confName; String confEmail; @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { value = qName; confEmail = qName; confName = qName; } @Override public void characters(char[] ch, int start, int length) throws SAXException { if (value.equals("Value")) { String OperationName1Text = new String(ch, start, length); info.setValue(OperationName1Text); Log.d("URL", OperationName1Text); } else if (confName.equals("t:EmailAddress")) { String getEmail = new String(ch, start, length); info.setEmail(getEmail); Log.d("Email", getEmail); } } @Override public void endElement(String uri, String localName, String qName) throws SAXException { value = qName; confEmail = qName; confName = qName; } </code></pre> <p>i am only able to display all the email address but i only want one mentioned above. What changes in the code is needed.?</p> <p>Anyone worked on similar situation can help Thanks Mike</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload