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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:30:17+00:00 2026-06-05T18:30:17+00:00

Using Perl XML::Twig, how can I loop on each sibling until reaching the last

  • 0

Using Perl XML::Twig, how can I loop on each sibling until reaching the last node ?

while (condition_sibling_TWIG, $v)
{
$v=$v->next_sibling;
$v->print;

# process $v 
}

Should the condition be ($v != undef) ?

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-05T18:30:19+00:00Added an answer on June 5, 2026 at 6:30 pm

    You can use next_siblings to get the list of siblings:

    foreach my $sibling ($elt->next_siblings)
      { # process sibling
      }
    

    next_siblings accepts an optional condition as argument, which is an XPath step, or at least the subset of XPath supported by XML::Twig: $elt->next_siblings('p[@type="secret"]'))

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

Sidebar

Related Questions

I'm using Perl's XML::Twig module to transform XML into (X)HTML. I need to output
i am trying to genarate XML from xsd using perl can anyone guide me
I'm using the Perl mod XML::SemanticDiff which can compare two XML documents. I want
I am using XML::Twig to parse my input xml using Perl. I need to
I'm having an issue accessing some nested data in an XML response using Perl/XML::Simple.
I am using Perl with XML::Simple to convert a hash into an XML document.
I'm creating an XML file using Perl and XML::Simple module. I successfully create the
I am using Perl to convert some XML to JSON. If the XML attribute
I currently have a Perl CGI script that parses incoming XML requests using XML::Simple
Replacing the Special Character using Perl while i am doing this . I got

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.