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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:25:23+00:00 2026-06-17T14:25:23+00:00

With the following xml, I’m trying to return true or false depending on whether

  • 0

With the following xml, I’m trying to return true or false depending on whether all <CrucialNumber> elements are empty or not:

<Invoice>
  <Details>
    <LIN1>
      <Quantity>1</Quantity>
      <Product>Test XML</Product>
      <CrucialNumber/>
    </LIN1>
    <LIN1>
      <Quantity>1</Quantity>
      <Product>Test XML</Product>
      <CrucialNumber/>
    </LIN1>
    <LIN1>
      <Quantity>1</Quantity>
      <Product>Test XML</Product>
      <CrucialNumber>123456</CrucialNumber>
    </LIN1>
  </Details>
</Invoice>

The data-type of the CrucialNumber element is string.

So far, these are the xpath expressions I have tried:

string-length(//CrucialNumber/*) > 0;    

not(//CrucialNumber/*[text()]);

./Details/LIN1[*]/CrucialNumber[1] = "";
  • 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-17T14:25:24+00:00Added an answer on June 17, 2026 at 2:25 pm
    not(.//CrucialNumber/node())
    

    should do it, it will be true if and only if either (a) there are no CrucialNumber descendant elements at all, or (b) all the descendant CrucialNumber elements are empty.

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

Sidebar

Related Questions

Let's consider the following XML document: <items> <item>item1</item> <item>item2</item> </items> Now, let's remove all
I have the following XML: <NET_SETTINGS> <MAC_ADDRESS VALUE=bb:cc:dd:ee:ff:aa/> <IP_ADDRESS VALUE=10.1.1.1/> </NET_SETTINGS> and trying to
I've got the following XML file: <?xml version=1.0 encoding=UTF-8 standalone=yes?> <invoice xmlns=http://www.jemos.co.uk/xsds/experiments> <header date=2012-12-27T13:17:03.652Z
I have the following xml layout: <ScrollView android:layout_width=match_parent android:layout_height=match_parent android:fillViewport=true > <LinearLayout android:layout_width=match_parent android:layout_height=match_parent
The following xml file always seems to validate. Not sure why, but when I
The following XML implementation seems to work fine: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I have the following XML :- <inventory> <item> <name_element> <!--some structure--> </name_element> <some_element1>val1</some_element1> <some_element2>val2</some_element2>
I have the following XML Document: <?xml version=\1.0\ encoding=\UTF-8\?> <atom:entry xmlns:atom=\http://www.w3.org/2005/Atom\ xmlns:apps=\http://schemas.google.com/apps/2006\ xmlns:gd=\http://schemas.google.com/g/2005\> <apps:property
I have the following xml - <Surveys xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation=ImmForm XML Schema NHS Direct.xsd><Svy SurveyName=WeeklyFluSurveillance2012/13-NHSDirectWeek40w/e07/10/2012
I have the following XML: <TRUCK Counter=0> <CARRIER>A PLUS EXPEDITING &amp; LOGISTICS INC.</CARRIER> <CARRIERPHONE>(000)000-0220</CARRIERPHONE>

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.