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

  • SEARCH
  • Home
  • 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 7410521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:14:45+00:00 2026-05-29T06:14:45+00:00

I have following xml: <TextWithNodes><Node id=0 />astralis<Node id=8 /> <Node id=9 />ltd<Node id=12 />

  • 0

I have following xml:

<TextWithNodes><Node id="0" />astralis<Node id="8" /> <Node id="9" />ltd<Node id="12" />
<Node id="14" />{<Node id="15" />DOCUMENT<Node id="23" />}<Node id="24" /> <Node id="25" />{<Node id="26" />TYPE<Node id="30" />}<Node id="31" />EX-<Node id="34" />10<Node id="36" />.<Node id="37" />12<Node id="39" /> <Node id="40" />{<Node id="41" />SEQUENCE<Node id="49" />}<Node id="50" />3<Node id="51" /> <Node id="52" />{<Node id="53" />FILENAME<Node id="61" />}<Node id="62" />e<Node id="63" />300201<Node id="69" />_<Node id="70" />ex<Node id="72" />10<Node id="74" />-<Node id="75" />12<Node id="77" />.<Node id="78" />txt<Node id="81" /> </TextWithNodes>

and I need to pick node from Id 25 to id 75. It is a portion of XML. Original XML is very long. How to do it without XPath?

Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("//Node[@id >" & 25 & " and @id <" & 75 & "]")

Dim sb As StringBuilder = New StringBuilder

For Each childNode As XmlNode In nodeList
    sb.Append(childNode.InnerText)
Next

but it is not working …

Please suggest.

Thanks

  • 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-29T06:14:46+00:00Added an answer on May 29, 2026 at 6:14 am

    [This is too long for a comment, so…]

    Reformatting the start of the XML:

    <TextWithNodes>
      <Node id="0" />
      astralis<Node id="8" />
      <Node id="9" />
      ltd
      <Node id="12" />
      < Node id="14" />
      {
      <Node id="15" />
      DOCUMENT
      <Node id="23" />
      }
      <Node id="24" />
      <Node id="25" />
      {
      <Node id="26" />
      TYPE
      <Node id="30" />
    

    shows that node of the Node elements have no content; rather the content is between the elements. So when you say:

    pick node from Id 25 to id 75

    do you want just the Node elements, or all the sibling XML DOM nodes – both elements and text – between the two identified Node elements, or just the Node elements?


    Answer: XPath thanks to this answer:

    /TextWithNodes/node()[preceding-sibling::Node[@id=25] and following-sibling::Node[@id=75]]
    

    which makes use of an empty node set being false: nodes before id="25" will have an empty preceding-sibling::... node set, similarly for the nodes after id="75".

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

Sidebar

Related Questions

I have following xml: <TextWithNodes><Node id=0 />astralis<Node id=8 /> <Node id=9 />ltd<Node id=12 />
I have the following XML document: <projects> <project> <name>Shockwave</name> <language>Ruby</language> <owner>Brian May</owner> <state>New</state> <startDate>31/10/2008
I have a following xml document: <node0> <node1> <node2 a1=x1> ... </node2> <node2 a1=x2>
I have the following XML- <rows> <row id=5> <cell>Item1</cell> <attrs> <attr> <id>1</id> <type>CheckBox</type> <values>
I have the following xml: <?xml version=1.0 encoding=utf-8 ?> <ROLES> <ROLE type=A> <USER name=w
I have a following XML structure that I need to transform: <recordset rowCount=68 fieldNames=ITEM,ECL,LEAD_TIME
I have the following XML: <root> <foo> <bar type=a whole bunch of stuff, then
I have following XML: <Library> <Item> <Field Name=Name>smooth</Field> <Field Name=File Type>mid</Field> <Field Name=File Size>60026</Field>
I have the following XML: <InterSection criteria=Microsoft-ASP>value</Intersection> <InterSection criteria=Microsoft-MVC>value</Intersection> <InterSection criteria=HP-MVC>value</Intersection> I need to
I have the following xml that I need to deserialise to an object: <animals>

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.