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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:25:57+00:00 2026-06-13T23:25:57+00:00

I have the following xml document (only a digest to show the structure, as

  • 0

I have the following xml document (only a digest to show the structure, as it is quite long):

<document>    
<article>
            <head>ISA Savers Could Lose Tax Relief</head>
            <text>
                <paragraph>Tax relief could be withdrawn from tens of thousands of Individual Savings Account, sheltering up to £500 million from tax, because some banks and building societies are flouting not only the spirit, but the letter of the laws governing them.</paragraph>
                <paragraph>This will come as alarming news to thousands of savers who invested in fixed rate Isas which they thought would offer them security combined with a tax shelter The Inland Revenue is writing to all Britain's savings institutions reminding them of the basic Isa rules and warning that tax relief will be withdrawn if these are manipulated in anyway.</paragraph>
                <paragraph>Furthermore, the Revenue will castigate some deposit-takers for already breaching the rules and demand they speedily rewrite their terms and conditions, or face loss of tax-relief.</paragraph>
                <paragraph>The guardian of the nations coffers is known to be deeply disturbed at the rapid recent growth of fixed- rate Isas which lock savers in for several years, maintaining these are unlawful. It is sending a stark reminder to all savings institutions that customers must be allowed to withdraw their cash, and requiring those which don't, to address the violation.</paragraph>
                <paragraph>At the front of the firing line are Bradford &amp; Bingley, Liverpool Victoria, and Julian Hodge Bank, which attracted huge inflows of money because they have been consistently among the best buys. All three specifically prohibit withdrawals. The Ipswich Building Society joined them last week, becoming the latest to offer a fixed- rate Isa, outlawing withdrawals until the end of the term.</paragraph>
                <paragraph>A written statement from the Revenue said:"When ISAs were introduced Ministers made it clear that one of the their main objectives was to encourage non-savers to start saving, and people with small amounts saved, to save more. It was therefore important that ISAs would not lock in savers' money as this would exclude people with limited resources who might need access to their money quickly.</paragraph>
                <paragraph>"We do not consider that a product whose terms and conditions actually prevented withdrawals or transfers during a fixed term would be consistent with Ministers' intentions or the statutory rules."</paragraph>
                <paragraph>So serious are the Revenue's concerns that they no longer trust banks and building societies to monitor themselves. They plan to introduce a new requirement which insists institutions submit full details of all Isa accounts to them for approval, before they becomes available to the public. Until now, banks merely had to satisify themselves they were not breaking the rules.</paragraph>
                <paragraph>Paul James, marketing manager of Julian Hodge Bank, said the fixed accounts were launched in response to customer demand.</paragraph>
                <paragraph>He said:"People were asking for a fixed rate, and those who have taken them out over the past couple of years have done well. We understood that Isas had to be transferable on notice, which we took to be the end of the fixed period.</paragraph>
                <paragraph>"We were audited by the Revenue last year, and the issue was not raised at that stage, so we thought everything was OK. If we have been successfully audited then the accounts can't be otherwise but OK surely?"</paragraph>
                <paragraph>Nigel Snell, a spokesman for Liverpool Victoria said that its range of five Isas prohibiting withdrawals did include a proviso in the small print allowing access to funds "in exceptional circumstances and by permission of the trustees".</paragraph>
                <paragraph>He added:"We make it clear to people that their money is locked away, but thought the account was compliant because of this clause in the small print."</paragraph>
                <paragraph>An Ipswich spokesman said it was aware there was some ambiguity when its account was launched last week. However, it acknowledged it may have to review its terms and conditions again, after seeing the letter from the Revenue.</paragraph>
            </text>
            <date>
                <day>10</day>
                <month>05</month>
                <year>2002</year>
            </date>
            <source>Sexymoney</source>
            <portal>Finance</portal>
            <ID number="2610981009.98103"/>
        </article>
.
.
.

I have to find all nodes in each article that occur after the head node and before the portal node.

I don’t know how to iterate through all the child nodes and grandchild nodes of the article node and compare it with the head node and portal node of the same article node.

Here is one of my attempts to solve the xpath query (which does obviously not work, because I don’t know how to iterate through all of the nodes for comparison):

for $x in //article return $x[$x/text >> $x/head and $x/text << $x/portal]//*

Thanks in advance for your answers

  • 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-13T23:25:58+00:00Added an answer on June 13, 2026 at 11:25 pm

    I. XPath 2.0 solution:

    Use:

    /*/article/*[. >> ../head and ../portal >> .]
    

    II. XPath 1.0 solution (it is also an XPath 2.0 solution):

    /*/article/head/following-sibling::*[following-sibling::portal]
    

    III. XSLT – based verification:

    This XSLT 2.0 transformation:

    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output omit-xml-declaration="yes" indent="yes"/>
    
     <xsl:template match="/">
         <xsl:sequence select="/*/article/*[. >> ../head and ../portal >> .]"/>
     </xsl:template>
    </xsl:stylesheet>
    

    when applied on the provided XML document:

    <document>
        <article>
            <head>ISA Savers Could Lose Tax Relief</head>
            <text>
                <paragraph>Tax relief could be withdrawn from tens of thousands of Individual Savings Account, sheltering up to £500 million from tax, because some banks and building societies are flouting not only the spirit, but the letter of the laws governing them.</paragraph>
                <paragraph>This will come as alarming news to thousands of savers who invested in fixed rate Isas which they thought would offer them security combined with a tax shelter The Inland Revenue is writing to all Britain's savings institutions reminding them of the basic Isa rules and warning that tax relief will be withdrawn if these are manipulated in anyway.</paragraph>
                <paragraph>Furthermore, the Revenue will castigate some deposit-takers for already breaching the rules and demand they speedily rewrite their terms and conditions, or face loss of tax-relief.</paragraph>
                <paragraph>The guardian of the nations coffers is known to be deeply disturbed at the rapid recent growth of fixed- rate Isas which lock savers in for several years, maintaining these are unlawful. It is sending a stark reminder to all savings institutions that customers must be allowed to withdraw their cash, and requiring those which don't, to address the violation.</paragraph>
                <paragraph>At the front of the firing line are Bradford &amp; Bingley, Liverpool Victoria, and Julian Hodge Bank, which attracted huge inflows of money because they have been consistently among the best buys. All three specifically prohibit withdrawals. The Ipswich Building Society joined them last week, becoming the latest to offer a fixed- rate Isa, outlawing withdrawals until the end of the term.</paragraph>
                <paragraph>A written statement from the Revenue said:"When ISAs were introduced Ministers made it clear that one of the their main objectives was to encourage non-savers to start saving, and people with small amounts saved, to save more. It was therefore important that ISAs would not lock in savers' money as this would exclude people with limited resources who might need access to their money quickly.</paragraph>
                <paragraph>"We do not consider that a product whose terms and conditions actually prevented withdrawals or transfers during a fixed term would be consistent with Ministers' intentions or the statutory rules."</paragraph>
                <paragraph>So serious are the Revenue's concerns that they no longer trust banks and building societies to monitor themselves. They plan to introduce a new requirement which insists institutions submit full details of all Isa accounts to them for approval, before they becomes available to the public. Until now, banks merely had to satisify themselves they were not breaking the rules.</paragraph>
                <paragraph>Paul James, marketing manager of Julian Hodge Bank, said the fixed accounts were launched in response to customer demand.</paragraph>
                <paragraph>He said:"People were asking for a fixed rate, and those who have taken them out over the past couple of years have done well. We understood that Isas had to be transferable on notice, which we took to be the end of the fixed period.</paragraph>
                <paragraph>"We were audited by the Revenue last year, and the issue was not raised at that stage, so we thought everything was OK. If we have been successfully audited then the accounts can't be otherwise but OK surely?"</paragraph>
                <paragraph>Nigel Snell, a spokesman for Liverpool Victoria said that its range of five Isas prohibiting withdrawals did include a proviso in the small print allowing access to funds "in exceptional circumstances and by permission of the trustees".</paragraph>
                <paragraph>He added:"We make it clear to people that their money is locked away, but thought the account was compliant because of this clause in the small print."</paragraph>
                <paragraph>An Ipswich spokesman said it was aware there was some ambiguity when its account was launched last week. However, it acknowledged it may have to review its terms and conditions again, after seeing the letter from the Revenue.</paragraph>
            </text>
            <date>
                <day>10</day>
                <month>05</month>
                <year>2002</year>
            </date>
            <source>Sexymoney</source>
            <portal>Finance</portal>
            <ID number="2610981009.98103"/>
        </article>
    </document>
    

    evaluates the XPath 2.0 expression and copies to the output all nodes selected:

    <text>
                <paragraph>Tax relief could be withdrawn from tens of thousands of Individual Savings Account, sheltering up to £500 million from tax, because some banks and building societies are flouting not only the spirit, but the letter of the laws governing them.</paragraph>
                <paragraph>This will come as alarming news to thousands of savers who invested in fixed rate Isas which they thought would offer them security combined with a tax shelter The Inland Revenue is writing to all Britain's savings institutions reminding them of the basic Isa rules and warning that tax relief will be withdrawn if these are manipulated in anyway.</paragraph>
                <paragraph>Furthermore, the Revenue will castigate some deposit-takers for already breaching the rules and demand they speedily rewrite their terms and conditions, or face loss of tax-relief.</paragraph>
                <paragraph>The guardian of the nations coffers is known to be deeply disturbed at the rapid recent growth of fixed- rate Isas which lock savers in for several years, maintaining these are unlawful. It is sending a stark reminder to all savings institutions that customers must be allowed to withdraw their cash, and requiring those which don't, to address the violation.</paragraph>
                <paragraph>At the front of the firing line are Bradford &amp; Bingley, Liverpool Victoria, and Julian Hodge Bank, which attracted huge inflows of money because they have been consistently among the best buys. All three specifically prohibit withdrawals. The Ipswich Building Society joined them last week, becoming the latest to offer a fixed- rate Isa, outlawing withdrawals until the end of the term.</paragraph>
                <paragraph>A written statement from the Revenue said:"When ISAs were introduced Ministers made it clear that one of the their main objectives was to encourage non-savers to start saving, and people with small amounts saved, to save more. It was therefore important that ISAs would not lock in savers' money as this would exclude people with limited resources who might need access to their money quickly.</paragraph>
                <paragraph>"We do not consider that a product whose terms and conditions actually prevented withdrawals or transfers during a fixed term would be consistent with Ministers' intentions or the statutory rules."</paragraph>
                <paragraph>So serious are the Revenue's concerns that they no longer trust banks and building societies to monitor themselves. They plan to introduce a new requirement which insists institutions submit full details of all Isa accounts to them for approval, before they becomes available to the public. Until now, banks merely had to satisify themselves they were not breaking the rules.</paragraph>
                <paragraph>Paul James, marketing manager of Julian Hodge Bank, said the fixed accounts were launched in response to customer demand.</paragraph>
                <paragraph>He said:"People were asking for a fixed rate, and those who have taken them out over the past couple of years have done well. We understood that Isas had to be transferable on notice, which we took to be the end of the fixed period.</paragraph>
                <paragraph>"We were audited by the Revenue last year, and the issue was not raised at that stage, so we thought everything was OK. If we have been successfully audited then the accounts can't be otherwise but OK surely?"</paragraph>
                <paragraph>Nigel Snell, a spokesman for Liverpool Victoria said that its range of five Isas prohibiting withdrawals did include a proviso in the small print allowing access to funds "in exceptional circumstances and by permission of the trustees".</paragraph>
                <paragraph>He added:"We make it clear to people that their money is locked away, but thought the account was compliant because of this clause in the small print."</paragraph>
                <paragraph>An Ipswich spokesman said it was aware there was some ambiguity when its account was launched last week. However, it acknowledged it may have to review its terms and conditions again, after seeing the letter from the Revenue.</paragraph>
            </text>
    <date>
                <day>10</day>
                <month>05</month>
                <year>2002</year>
            </date>
    <source>Sexymoney</source>
    

    This XSLT 1.0 transformation:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="/">
         <xsl:copy-of select=
         "/*/article/head/following-sibling::*[following-sibling::portal]"/>
     </xsl:template>
    </xsl:stylesheet>
    

    evaluates the XPath 1.0 expression on the provided XML document (above) and copies to the output the selected nodes, producing exactly the same result (above).

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

Sidebar

Related Questions

I have the following XML document: <tt xmlns=http://www.w3.org/ns/ttml xmlns:tts=http://www.w3.org/ns/ttml#styling xml:lang=en> <head></head> <body> <div xml:lang=it>
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 document, I need an xquery expression to know how
I have the following XML Document (that can be redesigned if necessary) that stores
I have following CDATA inside xml document: <![CDATA[ <p xmlns=>Refer to the below: <br/>
I have an XML document with a section similar to the following: <release_list> <release>
I have an xml document which consists of a number of the following: -
I have an XML document which contains nodes like following:- <a class=custom>test</a> <a class=xyz></a>
I have a XML Document (LessonData.xml) with lesson data in it, with the following
I have a HTML/XML document similar to the following. There can be one or

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.