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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:18:41+00:00 2026-05-29T11:18:41+00:00

Simplified Question: What’s the XPath to select all XML nodes with an attribute that

  • 0

Simplified Question:
What’s the XPath to select all XML nodes with an attribute that ends with the string “Notification”. The first and third nodes in this snippet:

 <events>
   <event name="CreatedNotification" />
   <event name="InfoLog" />
   <event name="UpdatedNotification" />
 </events>

Detailed Question:

I want to select multiple complexTypes from a xsd schema for binding with JAXB. This works for a single class: OrderStateChangeNotification

<jxb:bindings schemaLocation="apiv2.xsd">
  <jxb:bindings node="//xs:complexType[@name='OrderStateChangeNotification']">
    <inheritance:implements>com.google.checkout.sdk.notifications.Notification</inheritance:implements> 
  </jxb:bindings>
</jxb:bindings>

Here is the relevant snippet from the schema schema file:

  <xs:complexType name="OrderStateChangeNotification">
    <xs:all>
      <xs:element name="new-fulfillment-order-state" type="tns:FulfillmentOrderState" />
      <xs:element name="new-financial-order-state" type="tns:FinancialOrderState" />
      <xs:element name="previous-fulfillment-order-state" type="tns:FulfillmentOrderState" />
      <xs:element name="previous-financial-order-state" type="tns:FinancialOrderState" />
      <xs:element name="reason" type="xs:string" minOccurs="0" />
      <xs:element name="timestamp" type="xs:dateTime" />
      <xs:element name="google-order-number" type="xs:token" />
      <xs:element name="order-summary" type="tns:OrderSummary" minOccurs="0" />
    </xs:all>
    <xs:attribute name="serial-number" type="xs:string" use="required" />
  </xs:complexType>

  <xs:complexType name="ChargeAmountNotification">
    <xs:all>
      <xs:element name="timestamp" type="xs:dateTime" />
      <xs:element name="latest-charge-amount" type="tns:Money" />
      <xs:element name="latest-charge-fee" type="tns:FeeStructure" minOccurs="0" />
      <xs:element name="total-charge-amount" type="tns:Money" />
      <xs:element name="latest-promotion-charge-amount" type="tns:Money" minOccurs="0" />
      <xs:element name="google-order-number" type="xs:token" />
      <xs:element name="order-summary" type="tns:OrderSummary" minOccurs="0" />
    </xs:all>
    <xs:attribute name="serial-number" type="xs:string" use="required" />
  </xs:complexType>

I want the binding to apply to all notification objects. They all end in with “Notification”

I’ve tried changing the XPath from

//xs:complexType[@name='OrderStateChangeNotification']

to

//xs:complexType[substring(name(), string-length(name()) - 12) = 'Notification']

but it didn’t work.

Another approach is to try and select all nodes with the children “order-summary” and “serial-number” as I know only Notification objects have these.

UPDATE:
The solution by @Lee Greco correctly selectes the nodes I wanted, but unfortunatly, the inheritance plugin is not compatible with multiple nodes:

[ERROR] XPath evaluation of "//xs:complexType[substring(@name, string-length(@name)-string-length('Notification')+1)='Notification']" results in too many (8) target nodes

I ended up just enumerating them separately.

  • 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-29T11:18:42+00:00Added an answer on May 29, 2026 at 11:18 am

    With the

    //xs:complexType[substring(name(), string-length(name()) - 12) = 'Notification']
    

    expression you’re asking for all elements where the element name ends in ‘Notification’. You really want to ask for all elements with a name attribute that ends in ‘Notification’.

    Try this instead:

    //xs:complexType[substring(@name, string-length(@name)-string-length("Notification")+1)="Notification"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have next code that represents graph edges and nodes (simplified for question): public
First let me preface this question by saying that I'm fairly new to Javascript.
All in the question title, and my simplified code below. According to the docs:
Another PL/SQL refactoring question! I have several cursors that are of the general simplified
New to Django, third question on it today... I have the following (simplified) models
This is a simplified example that should be enough for the question. @interface MyClass:
This is a simplified example to illustrate the question: class A {}; class B
This is heavily simplified for the sake of the question. Say I have a
This question is partly about delegates, and partly about generics. Given the simplified code:
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has

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.