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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:11:40+00:00 2026-06-01T17:11:40+00:00

what is the correct query to select the the Abstract Node which is implemented

  • 0

what is the correct query to select the the “Abstract” Node which is implemented by XYZImpl from http://www.namspace.org/impl?

<...>
  <Abstract xmlns:q3="http://www.namspace.org/impl"
                xsi:type="q3:XYZImpl">
    <...></...>
  </Abstract>
  <Abstract xmlns:q8="http://www.namspace.org/another"
                xsi:type="q8:XYZImpl">
    <...></...>
  </Abstract>
 </...>

order and namespace prefix are not under my control

If the document just contains unique implementations the following query “works”:

//Abstract[contains(@xsi:type,'XYZImpl')]

but I am searching for the right specification for the full qualified Name (namespace + Name)… :/

  • 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-01T17:11:41+00:00Added an answer on June 1, 2026 at 5:11 pm

    Use:

       /*/Abstract
           [substring-after(@xsi:type, ':') = 'XYZImpl']
              [namespace::*
                  [name() = substring-before(../@xsi:type, ':')
                  and
                   . = 'http://www.namspace.org/impl'
                  ]
              ]
    

    This selects any Abstract child of the top element of the XML document that has a namespace with a prefix, which is also the prefix of the QName value contained in its xsi:type attribute. And the “local-name” part of the QName value contained in the xsi:type attribute is exactly the string "XYZImpl" .

    XSLT – based verification:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:xsi="some:xsi">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="/">
         <xsl:copy-of select=
          "/*/Abstract
               [substring-after(@xsi:type, ':') = 'XYZImpl']
                  [namespace::*
                      [name() = substring-before(../@xsi:type, ':')
                      and
                       . = 'http://www.namspace.org/impl'
                      ]
                  ]
          "/>
     </xsl:template>
    </xsl:stylesheet>
    

    When this transformation is applied on the following XML document (produced by the provide, by making it well-formed):

    <t xmlns:xsi="some:xsi">
          <Abstract xmlns:q3="http://www.namspace.org/impl"
                        xsi:type="q3:XYZImpl">
           </Abstract>
          <Abstract xmlns:q8="http://www.namspace.org/another"
                        xsi:type="q8:XYZImpl">
          </Abstract>
    </t>
    

    the wanted, correct element is selected and copied to the output:

    <Abstract xmlns:q3="http://www.namspace.org/impl" xmlns:xsi="some:xsi" xsi:type="q3:XYZImpl"/>
    

    Do note: In order for the XPath expression to be evaluated successfully, the appropriate namespace with prefix xsi must be registered with your XPath implementation.

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

Sidebar

Related Questions

select station_id,count(case_id) from emer_complaint group by station_id Above query returning the correct result. But,
I have the query select * from products p, products_temp t where p.ManufacturerPartNumber =
In SQL Server, I have this query SELECT DISTINCT City FROM Person.Address But this
The Query is as follows: SELECT v2.video_id FROM `VideoTags` AS v1 JOIN `VideoTags` AS
I have this JDBC SQL query: select * from table where TX_DATE = {d
I have this query: SELECT COUNT( tbl_workstation.workstation_id ) AS AVAILABLE, tbl_lab.room_no, tbl_lab.capacity FROM tbl_workstation,
I have the following query SELECT * FROM (`user_profiles`) WHERE `user_id` = $user_id LIMIT
I'm trying for hours to find out the correct SQL query to select the
My current query: SELECT Series.*, Episodes.* FROM Series, Episodes WHERE EpisodeAirDate > '.time().' AND
I'm using this sql query: select sysdate, sysdate - INTERVAL '6' month from dual;

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.