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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:57:06+00:00 2026-06-04T06:57:06+00:00

I’m struggling to get my head around XML namespace query when using XML nodes

  • 0

I’m struggling to get my head around XML namespace query when using XML nodes – I’ve read other similar questions here and an article here but cannot apply this to my specific query.

I have a larger version of this sample XML:

SELECT CAST('<Navigator clsid="{ABF8EB05-610D-11D3-A53E-684F745C}">
  <Version>7</Version>
  <NavigatorNodes clsid="{0484ACB1-78F5-48D7-A26B-3A0ACD3A5F91}">
    <NavigatorNode clsid="{59AB61BD-7833-4954-94C2-B6D737E3DD6F}">
      <Indent>0</Indent>
      <Caption>Contact</Caption>
      <Selected>0</Selected>
      <ViewType>0</ViewType>
      <ViewSubType>0</ViewSubType>
      <ShowTotals>0</ShowTotals>
      <RowHeight>0</RowHeight>
      <Complement>0</Complement>
      <FreezeFirst>0</FreezeFirst>
      <a1:QueryFilter xmlns:a2="http://www.ascenttechnology.co.uk/schemas/entities" xmlns:xsi="http://www.w3.org/21/XMLSchema-instance" xmlns:a1="http://www.ascenttechnology.co.uk/schemas/services" Type="QueryFilter">
        <entity_name>Contact</entity_name>
        <relationship_name />
        <relationship_from_entity_name />
        <a1:ColumnInfoCollection Type="ColumnInfoCollection" AscentCollection="true">
          <__vers>1</__vers>
          <IgnoreMissingItem>0</IgnoreMissingItem>
          <ReadOnly>0</ReadOnly>
          <AllowNulls>0</AllowNulls>
          <a1:ColumnInfo Type="ColumnInfo">
            <attribute_name>state</attribute_name>
            <width>0</width>
          </a1:ColumnInfo>
          <a1:ColumnInfo Type="ColumnInfo">
            <attribute_name>current_address_suffix</attribute_name>
            <width>0</width>
          </a1:ColumnInfo>
        </a1:ColumnInfoCollection>
        <a1:SurveyColumnInfoCollection Type="AttributeInfoCollection" AscentCollection="true">
          <__vers>1</__vers>
          <IgnoreMissingItem>0</IgnoreMissingItem>
          <ReadOnly>0</ReadOnly>
          <AllowNulls>0</AllowNulls>
        </a1:SurveyColumnInfoCollection>
        <a1:WorkflowColumnInfoCollection Type="AttributeInfoCollection" AscentCollection="true">
          <__vers>1</__vers>
          <IgnoreMissingItem>0</IgnoreMissingItem>
          <ReadOnly>0</ReadOnly>
          <AllowNulls>0</AllowNulls>
        </a1:WorkflowColumnInfoCollection>
        <a1:ConditionCollection Type="ConditionCollection" AscentCollection="true">
          <__vers>1</__vers>
          <IgnoreMissingItem>0</IgnoreMissingItem>
          <ReadOnly>0</ReadOnly>
          <AllowNulls>0</AllowNulls>
          <a1:Condition Type="Condition">
            <attribute_name>class</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>28</operator>
            <value1>1</value1>
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>do_not_mail</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>0</operator>
            <value1>True</value1>
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>gone_away</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>0</operator>
            <value1>True</value1>
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>dp_opt_out</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>0</operator>
            <value1>True</value1>
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>deceased</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>0</operator>
            <value1>True</value1>
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>deleted</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>0</operator>
            <value1>True</value1>
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>Date_Of_Birth</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>19</operator>
            <value1>2010-06-23T::.+:</value1>
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>home_address1</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>26</operator>
            <value1 xsi:nil="true" />
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>home_postcode</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>26</operator>
            <value1 xsi:nil="true" />
            <value2 xsi:nil="true" />
            <indent_level>1</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>home_address1</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>0</operator>
            <value1 />
            <value2 xsi:nil="true" />
            <indent_level>0</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
          <a1:Condition Type="Condition">
            <attribute_name>home_postcode</attribute_name>
            <description1 />
            <description2 />
            <attribute_id>0</attribute_id>
            <not>0</not>
            <operator>0</operator>
            <value1 />
            <value2 xsi:nil="true" />
            <indent_level>1</indent_level>
            <value1_is_reference>0</value1_is_reference>
            <value2_is_reference>0</value2_is_reference>
          </a1:Condition>
        </a1:ConditionCollection>
        <a1:OrderByCollection Type="OrderByCollection" AscentCollection="true">
          <__vers>1</__vers>
          <IgnoreMissingItem>0</IgnoreMissingItem>
          <ReadOnly>0</ReadOnly>
          <AllowNulls>0</AllowNulls>
        </a1:OrderByCollection>
        <SelectedArticles xsi:nil="true" />
        <groupby_field_name />
        <reporting_currency>52</reporting_currency>
        <Negate_Filter>0</Negate_Filter>
        <Survey_Id>----</Survey_Id>
        <Survey_Name xsi:nil="true" />
        <Workflow_Id>----</Workflow_Id>
        <Workflow_Name xsi:nil="true" />
        <XPath>0</XPath>
        <locale>0</locale>
      </a1:QueryFilter>
    </NavigatorNode>
  </NavigatorNodes>
</Navigator>' AS XML) as xmldata

And have been trying queries to get to the information contained within the a1:Condition Node. I’ve tried queries such as:

;WITH XMLNAMESPACES(
'http://www.ascenttechnology.co.uk/schemas/services' AS a1
,'http://www.ascenttechnology.co.uk/schemas/entities' AS a2
,DEFAULT 'http://www.w3.org/21/XMLSchema-instance'
)
SELECT 
#xmldata.*
,ref.value('attribute_name[1]','NVARCHAR(50)') as attribute_name
FROM #xmldata
CROSS APPLY xmldata.nodes('/Navigator/NavigatorNodes/NavigatorNode/a1:QueryFilter/a1:ConditionCollection/a1:Condition') T(ref)

But they’re always coming back blank when I get near the namespaced nodes – I’m able to pull data from the nodes all the way up to '/Navigator/NavigatorNodes/NavigatorNode' but then have no luck.

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-06-04T06:57:07+00:00Added an answer on June 4, 2026 at 6:57 am

    You declare DEFAULT 'http://www.w3.org/21/XMLSchema-instance' but your XML string does even not have a default namespace.

    Try

    WITH XMLNAMESPACES(
      'http://www.ascenttechnology.co.uk/schemas/services' AS a1
    , 'http://www.ascenttechnology.co.uk/schemas/entities' AS a2
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.