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 8871595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:01:36+00:00 2026-06-14T18:01:36+00:00

My xml looks like <article> <article-id pub-id-type=local>ABC</article-id> <article-id pub-id-type=external>XYZ</article-id> </article> I can do the

  • 0

My xml looks like

<article>
    <article-id pub-id-type="local">ABC</article-id>
    <article-id pub-id-type="external">XYZ</article-id>
</article>

I can do the following

dim articleId as string =  doc.SelectSingleNode("./article/article-id", nsm).InnerText

and the result is ABC

I don’t know how to get the result to be XYZ – I assume because I’m using SelectSingleNode it is getting the First item. Is there a way to tell it to get the second?

Please note, although I’ve shown an example with only 2 nodes, there could be any number so it must be ‘searchable’ by the name ‘external’

I’ve not really used .NET 2.0 before and the MSDN didn’t really help me.

Any help would be great, thank you.

  • 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-06-14T18:01:37+00:00Added an answer on June 14, 2026 at 6:01 pm

    You can use the following XPath:

    "./article/article-id[@pub-id-type='external']"
    

    The [@pub-id-type='external'] is an attribute filter.

    If you have multiple possible elements, you could add [last()] to get the last of them.

    For more XPath info, check out this page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My xml looks like this: <nodes><skus><sku>abc</sku><sku>def123</sku></skus></nodes> I want to get all the elements with
my xml structure looks like this: <entity id=1000070> <name>apple</name> <type>category</type> <entities> <entity id=7002870> <name>mac</name>
I have XML that looks like this <xml> <news> <newsitem> <publishdate>2011-10-11</publishdate> <title>Article 1</title> <breakingnewsflag>false</breakingnewsflag>
I have a Java string which looks like this, it is actually an XML
I have a model that looks like: @XStreamAlias(article) class Article { List<String> tags; List<String>
My xml looks like <details> <addr> <streetAddressLine>90822 abc lane</streetAddressLine> <streetAddressLine>apt b</streetAddressLine> <!-- streetAddressLine element
I have an xml file that looks like the following. What I'm trying to
My XML looks like : <?xml version=\1.0\?> <itemSet> <Item>one</Item> <Item>two</Item> <Item>three</Item> .....maybe more Items
My xml looks like: <nodes> <node name=somekey> <item name=subject>blah</item> <item name=body>body</item> </node> </nodes> And
My xml looks like this- <?xml version=1.0 encoding=UTF-8?> <root> <Objects> <object1>object1Value</object1> <object2>object1Value</object2> </Objects> </root>

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.