Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3488130
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:13:59+00:00 2026-05-18T11:13:59+00:00

I have the following XML <ProjectResponse xmlns=Services.Messages xmlns:i=http://www.w3.org/2001/XMLSchema-instance> <Projects xmlns:a=Services.DTO> <a:Project> <a:ID>113</a:ID> <a:Name>Test project</a:Name>

  • 0

I have the following XML

<ProjectResponse xmlns="Services.Messages" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">    
  <Projects xmlns:a="Services.DTO">
    <a:Project>
      <a:ID>113</a:ID>
      <a:Name>Test project</a:Name>
      <a:Documents>
        <a:ProjectDocument>
          <a:FileName>DS.docx</a:FileName>
          <a:ID>65</a:ID>
          <a:ProjectID>113</a:ProjectID>
        </a:ProjectDocument>        
      </a:Documents>
    </a:Project>
  </Projects>
</ProjectResponse>

When i perform $(this).find(‘[nodeName=a:ID]’) in ‘each’ function i get 2 IDs, one from Project and another from Document.

$(projectsXml).find('Projects').children().each(function() {
            var projectId = $(this).find('[nodeName=a:ID]').text();

The question is how can i get only Project ID, not Document ID and another IDs that can occur ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:14:00+00:00Added an answer on May 18, 2026 at 11:14 am

    Use .children() instead of .find() inside as well, so it only looks for immediate children, like this:

    $(projectsXml).find('Projects').children().each(function() {
      var projectId = $(this).children('[nodeName=a:ID]').text();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following xml - <Surveys xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation=ImmForm XML Schema NHS Direct.xsd><Svy SurveyName=WeeklyFluSurveillance2012/13-NHSDirectWeek40w/e07/10/2012
I have the following XML: <?xml version=1.0 encoding=utf-8?> <ArrayOfTrafficResponseIncident xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema> <TrafficResponseIncident> <IncidentReportId>220</IncidentReportId> <IncidentNumber>137</IncidentNumber>
I have the following XML: <?xml version=1.0?> <coll xmlns=http://www.example.org/coll xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://www.example.org/coll coll.xsd> <collection> <item
I have following XML schema: <?xml version=1.0 encoding=UTF-8 standalone=no?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:element name=content type=contentType/>
I have the following Xml in my Resources.xmltest: <?xml version=1.0 encoding=utf-8 ?> <Response xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
I have following xml: <xs:schema attributeFormDefault=unqualified elementFormDefault=qualified xmlns=http://www.testuri.org targetNamespace=http://www.testuri.org xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:element name=Price> <xs:complexType> <xs:sequence>
I have the following XML Document: <?xml version=\1.0\ encoding=\UTF-8\?> <atom:entry xmlns:atom=\http://www.w3.org/2005/Atom\ xmlns:apps=\http://schemas.google.com/apps/2006\ xmlns:gd=\http://schemas.google.com/g/2005\> <apps:property
I have following XML file: <?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:jaxrs=http://cxf.apache.org/jaxrs xmlns:context=http://www.springframework.org/schema/context xmlns:cxf=http://cxf.apache.org/core
I have the following XML example: <?xml version=1.0 encoding=UTF-8?> <OpenSearchDescription xmlns=http://a9.com/-/spec/opensearch/1.1/ xmlns:custom=http://example.com/opensearchextensions/1.0/> <ShortName>Test</ShortName> <Description>Testing....</Description>
i have following xml file as input .... <?xml version=1.0 encoding=ISO-8859-1?> <T0020 xsi:schemaLocation=http://www.safersys.org/namespaces/T0020V1 T0020V1.xsd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.