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

  • Home
  • SEARCH
  • 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 8807119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:17:37+00:00 2026-06-14T02:17:37+00:00

For this xml file : <ROOT> <A> <B>2</B> <C>3</C> <D> <E>12</E> </D> <F/> <G/>

  • 0

For this xml file :

<ROOT>
  <A>
    <B>2</B>
    <C>3</C>
    <D>
      <E>12</E>
    </D>
    <F/>
    <G/>
  </A> 
</ROOT>

How could I get the number of node like B and C, in which there is a value but no children ?

In this case , the number should be 2.

  • 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-14T02:17:38+00:00Added an answer on June 14, 2026 at 2:17 am

    If you know which certain node you want (most the time you know) I prefer using XPath for selecting nodes (less coding).

    Consider this short sample:

     set serveroutput on;
     declare
       XML CLOB;
       XML_DOCUMENT DBMS_XMLDOM.DOMDOCUMENT;
       XML_NODE DBMS_XMLDOM.DOMNODE;
     begin
       XML := '
       <ROOT>
         <A>
           <B>2</B>
           <C>3</C>
           <D>
             <E>12</E>
           </D>
           <F/>
           <G/>
         </A> 
       </ROOT>
       ';
    
       XML_DOCUMENT := DBMS_XMLDOM.NEWDOMDOCUMENT(XML);
       XML_NODE := DBMS_XMLDOM.MAKENODE(XML_DOCUMENT);
       XML_NODE := DBMS_XSLPROCESSOR.SELECTSINGLENODE(XML_NODE,'ROOT/A/B/text()');
       IF(DBMS_XMLDOM.ISNULL(XML_NODE) = FALSE)
       THEN
         dbms_output.put_line(DBMS_XMLDOM.GETNODEVALUE(XML_NODE));
       END IF;
     end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am receiving this XML file which I would like to validate. Ideally I
I have an XML file like this to work with. <root> <ignore> <child>1</child> </ignore>
I had XML files like this: <root> <key0>value</key0> <key1>value</key1> <key2>value</key2> </root> It's easy to
I have this XML at http://localhost/file.xml : <?xml version=1.0 encoding=utf-8?> <val:Root xmlns:val=http://www.hw-group.com/XMLSchema/ste/values.xsd> <Agent> <Version>2.0.3</Version>
I have this xml file which has text init. i.e Hi my name is
Could someone explain what the build.xml file is used for in the root folder
I have an xml file like down below. I want to get pharmacies nodes'
I am using this XML file: <root> <level1 name="A"> <level2 name="A1" /> <level2 name="A2"
With this XML file - <Instructions> <Admin> <Instruction> Steps must be completed in order.&lt;/br&gt;
This is my Xml file.i want to transform this xml file into another customized

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.