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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:06:02+00:00 2026-05-19T22:06:02+00:00

Im struggling to return a XMLNodeList of the row elements under the TableRows Element

  • 0

Im struggling to return a XMLNodeList of the row elements under the TableRows Element of an RDLC file. There are many examples of namespaces being the cause, but ive tried them all and cant get any nodes back from my XPath query, though in fairness i dont really understand default/namespaces etc. i have checked the Default Namespace property in quickwatch and it says its “” ?? though i dont know why or how to set it as its readonly.

ive defined my namespaces with:

        Dim doc As XmlDocument = New XmlDocument()
        doc.Load(fname)
        Dim root As XmlNode = doc.DocumentElement
        Dim nsmgr As New XmlNamespaceManager(doc.NameTable)
        nsmgr.AddNamespace("rd", "http://schemas.microsoft.com/SQLServer/reporting/reportdesigner")
        nsmgr.AddNamespace("pf", "http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition")

then later in the code where im wanting to do something with the rows i pass lst As XmlNode and do:

    ' FIRST FIND THE <TableRows> NODE, UNDER MY CURRENT <Header> ELEMENT
    Dim TableRowsNode As XmlNode = lst.Item("TableRows") ' where lst is the <Header> element of the table in the rdlc i want to process

    ' GET ALL THE ROWS WITHIN THE <TABLEROWS> NODE
    Dim Rows As XmlNodeList = TableRowsNode.SelectNodes("//rd:TableRow", ns) ' where ns is the above nsmgr


    ' FOR EACH ROW
    For Each TableRow As XmlNode In Rows

        ' GET ALL THE CELLS
        Dim TableCells As XmlNode = TableRow.Item("TableCells")

        ' FOR EACH CELL
        For Each TableCell As XmlNode In TableCells

            Dim ReportItems As XmlNode = TableCell.Item("ReportItems")
            For Each ReportItem As XmlNode In ReportItems

                Select Case ReportItem.Name
                    Case "Textbox"
                        txt_lst.Add(ReportItem)
                    Case "Image"
                        img_lst.Add(ReportItem)
                End Select

            Next ' each report item

        Next ' each cell

    Next ' each row

ive tried
“./TableRow”
“//TableRow”
“.//TableRows”
“//rd:TableRow”
“//pf:TableRow”
and a host of other variants but the TableRowsNode.SelectNodes(..) line never returns any results (count=0)

what am i doing wrong?

here are a couple of snippets of the relevant sections of the rdlc im loading:

<?xml version="1.0" encoding="utf-8"?>
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">

and the section im interested in…

 <Table Name="table2">
  .....
    <Header>
      <TableRows>
        <TableRow>
        ....
        </TableRow>
        <TableRow>
        .....
        </TableRow>
      </TableRows>  

i want a NodeList of the “TableRow” elements so that i can generate a list of images, textboxes etc that i will be processing and generally doing stuff with (for those interested, generating math symbol images, swapping resource strings for thier associated text etc) …

ive been at this for too long, and there must be something stupid simple im missing as all searches lead to the same solution namespaces, and the xpath query string…

please help.

Edit:
got the xpath query to sort of work with “//pf:TableRow” but it was returning all nodes from the entire doc, so i gave up and just used

Dim Rows As XmlNodeList = TableRowsNode.ChildNodes  

Edit:
apparently the “//” makes it search from the top level of the doc, but i cant get “.//pf:TableRow” to return only those matching nodes under the current one? ill come back to this later when i have more time.

  • 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-19T22:06:03+00:00Added an answer on May 19, 2026 at 10:06 pm

    This is the most FAQ for the xpath tag. Search for “xpath default namespace” and you’ll find many good answers, including ones from SO.

    In VB.NET one should use the XmlNamespaceManager class to register a name and associate a prefix (say “x”) with it.

    Then instead of

    TableRow
    

    use:

    x:TableRow
    

    and so on for all names of elements that are in the default namespace.

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

Sidebar

Related Questions

I have a function runAjax that functions correctly. Unfortunately I am struggling to return
I am struggling to get preg_match to return only the image URL and not
I am struggling to find a working query in SQLite, that will return my
I'm still struggling to Stream a file to the HTTP response in Pylons .
I have been struggling with getting a field value change to commit. Is there
Im struggling to understand what this calculation is return base * power(base, exponent -
I am struggling to return a set of results to an automplete plugin as
I have been struggling with a program that calls functions which return strings. I
All three statements below return the same result. So I'm struggling to see what
I'm Java programmer and I'm struggling with this simple stuff. How can I return

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.