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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:04:59+00:00 2026-06-01T12:04:59+00:00

I want to select all nodes <cci:p> that do not have an attribute. So,

  • 0

I want to select all nodes <cci:p> that do not have an attribute.

So, in the example below, there’s a node (denoted with bold text or **) that is causing me some issues. Basically, I want to select all <cci:p> nodes and output them wrapped in <p> tags. But this node causes an extra paragraph to be outputted, which is incorrect. In this instance, what I would like to have happen is that if a node with that attribute is found, I want to append it to the previously processed node.

Here’s what I’m getting:

OAKLAND, Calif. ��� A former student suspected of opening fire at a small Christian
college in California, killing seven people and wounding three, was targeting a school
administrator and former classmates who he felt had treated him unfairly, police said
yesterday.

Oakland Police Chief Howard Jordan said at a news conference that One Goh, 43, who
had been expelled from Oikos University, had been cooperative with investigators

after being taken into custody but ���not particularly remorseful.���

���We know that he came here with the intent of locating an administrator, and she was
not here,��� Jordan said. ���He then went through the entire building systematically and
randomly shooting victims.���

Here’s what I would like to get:

OAKLAND, Calif. ��� A former student suspected of opening fire at a small Christian
college in California, killing seven people and wounding three, was targeting a school
administrator and former classmates who he felt had treated him unfairly, police said
yesterday.

Oakland Police Chief Howard Jordan said at a news conference that One Goh, 43, who
had been expelled from Oikos University, had been cooperative with investigators
after being taken into custody but ���not particularly remorseful.���

���We know that he came here with the intent of locating an administrator, and she was
not here,��� Jordan said. ���He then went through the entire building systematically and
randomly shooting victims.���

Sample XML:

<cci:body class="element" displayname="body" name="body">
    <cci:p>OAKLAND, Calif. — A former student suspected of opening fire at a small Christian college in California, killing seven people and wounding three, was targeting a school administrator and former classmates who he felt had treated him unfairly, police said yesterday.</cci:p>
    <cci:p>Oakland Police Chief Howard Jordan said at a news conference that One Goh, 43, who had been expelled from Oikos University, had been cooperative with investigators </cci:p>
    **<cci:p ccix:annotation="insertion">after being taken into custody but “not particularly remorseful.”</cci:p>**
    <cci:p>“We know that he came here with the intent of locating an administrator, and she was not here,” Jordan said. “He then went through the entire building systematically and randomly shooting victims.”</cci:p>
    <cci:p>The midmorning attack at Oikos, a small Oakland college that has links to the Korean-American Christian community, was the deadliest shooting rampage on a U.S. college campus since </cci:p>
</cci:body>

Sample XSLT:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cci="urn:schemas-ccieurope.com"
    xmlns:ccit="http://www.ccieurope.com/xmlns/ccimltables" xmlns:ccix="http://www.ccieurope.com/xmlns/ccimlextensions"
    exclude-result-prefixes="xsl cci ccit ccix">

    <xsl:strip-space elements="*" />
    <xsl:output method="html" encoding="UTF-8" />

    <xsl:template match="/">
        <html>
            <xsl:apply-templates />
        </html>
    </xsl:template>

    <xsl:template match="cci:p">
        <xsl:choose>
            <xsl:when test="@ccix:annotation='insertion'">
                <xsl:apply-templates />
            </xsl:when>

            <xsl:otherwise>
                <p>
                    <xsl:apply-templates />
                </p>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template match="cci:italic">
        <em>
            <xsl:apply-templates />
        </em>
    </xsl:template>

    <xsl:template match="cci:endnote_contrib">
        <em>
            <xsl:apply-templates />
        </em>
    </xsl:template>

    <xsl:template match="cci:extra_leading">
    </xsl:template>

    <xsl:template match="cci:bold">
        <strong>
            <xsl:apply-templates />
        </strong>
    </xsl:template>

    <xsl:template match="cci:subhead">
        <h2 class="cci-subhead">
            <xsl:value-of select="." />
        </h2>
    </xsl:template>

    <xsl:template match="ccit:table">
        <table class="cci-table">
            <xsl:apply-templates />
        </table>
    </xsl:template>

    <xsl:template match="ccit:tr">
        <tr>
            <xsl:apply-templates />
        </tr>
    </xsl:template>

    <xsl:template match="ccit:td">
        <td>
            <xsl:value-of select="." />
        </td>
    </xsl:template>

    <xsl:template match="cci:l_category">
        <h2 class="cci-category">
            <xsl:value-of select="." />
        </h2>
    </xsl:template>

    <xsl:template match="cci:l_category_sub">
        <h2 class="cci-category-sub">
            <xsl:value-of select="." />
        </h2>
    </xsl:template>

    <xsl:template match="cci:l_region">
        <h2 class="cci-region">
            <xsl:value-of select="." />
        </h2>
    </xsl:template>

    <xsl:template match="cci:l_region_location">
        <h2 class="cci-region-location">
            <xsl:value-of select="." />
        </h2>
    </xsl:template>

    <xsl:template match="cci:l_region_sub">
        <h2 class="cci-region-sub">
            <xsl:value-of select="." />
        </h2>
    </xsl:template>

    <xsl:template match="factbox_bold">
        <strong>
            <xsl:apply-templates />
        </strong>
    </xsl:template>

    <xsl:template match="cci:factbox_head">
        <strong>
            <xsl:value-of select="." />
        </strong>
    </xsl:template>

    <xsl:template match="cci:z_sym_round_bullet">
        &#8226;
        <xsl:value-of select="." />
    </xsl:template>

    <xsl:template match="cci:z_sym_triangle_bullet">
        &#8226;
        <xsl:value-of select="." />
    </xsl:template>

    <xsl:template match="text()">
        <xsl:value-of select="." />
    </xsl:template>
</xsl:stylesheet>
  • 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-01T12:05:00+00:00Added an answer on June 1, 2026 at 12:05 pm

    I would define a key to map the elements with that attribute to the preceding sibling you want to insert them in:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cci="urn:schemas-ccieurope.com"
        xmlns:ccit="http://www.ccieurope.com/xmlns/ccimltables" xmlns:ccix="http://www.ccieurope.com/xmlns/ccimlextensions"
        exclude-result-prefixes="xsl cci ccit ccix">
    
        <xsl:key name="k1" match="cci:p[@ccix:annotation = 'insertion']"
          use="generate-id(preceding-sibling::cci:p[not(@ccix:annotation)][1])"/>
    
        <xsl:strip-space elements="*" />
        <xsl:output method="html" encoding="UTF-8" />
    
        <xsl:template match="/">
            <html>
                <xsl:apply-templates />
            </html>
        </xsl:template>
    
        <xsl:template match="cci:p[not(@ccix:annotation)]">
          <p>
            <xsl:apply-templates select="node() | key('k1', generate-id())/node()"/>
          </p>
        </xsl:template>
    
        <xsl:template match="cci:p[@ccix:annotation = 'insertion']"/>
    
        <xsl:template match="cci:italic">
            <em>
                <xsl:apply-templates />
            </em>
        </xsl:template>
    
        <xsl:template match="cci:endnote_contrib">
            <em>
                <xsl:apply-templates />
            </em>
        </xsl:template>
    
        <xsl:template match="cci:extra_leading">
        </xsl:template>
    
        <xsl:template match="cci:bold">
            <strong>
                <xsl:apply-templates />
            </strong>
        </xsl:template>
    
        <xsl:template match="cci:subhead">
            <h2 class="cci-subhead">
                <xsl:value-of select="." />
            </h2>
        </xsl:template>
    
        <xsl:template match="ccit:table">
            <table class="cci-table">
                <xsl:apply-templates />
            </table>
        </xsl:template>
    
        <xsl:template match="ccit:tr">
            <tr>
                <xsl:apply-templates />
            </tr>
        </xsl:template>
    
        <xsl:template match="ccit:td">
            <td>
                <xsl:value-of select="." />
            </td>
        </xsl:template>
    
        <xsl:template match="cci:l_category">
            <h2 class="cci-category">
                <xsl:value-of select="." />
            </h2>
        </xsl:template>
    
        <xsl:template match="cci:l_category_sub">
            <h2 class="cci-category-sub">
                <xsl:value-of select="." />
            </h2>
        </xsl:template>
    
        <xsl:template match="cci:l_region">
            <h2 class="cci-region">
                <xsl:value-of select="." />
            </h2>
        </xsl:template>
    
        <xsl:template match="cci:l_region_location">
            <h2 class="cci-region-location">
                <xsl:value-of select="." />
            </h2>
        </xsl:template>
    
        <xsl:template match="cci:l_region_sub">
            <h2 class="cci-region-sub">
                <xsl:value-of select="." />
            </h2>
        </xsl:template>
    
        <xsl:template match="factbox_bold">
            <strong>
                <xsl:apply-templates />
            </strong>
        </xsl:template>
    
        <xsl:template match="cci:factbox_head">
            <strong>
                <xsl:value-of select="." />
            </strong>
        </xsl:template>
    
        <xsl:template match="cci:z_sym_round_bullet">
            &#8226;
            <xsl:value-of select="." />
        </xsl:template>
    
        <xsl:template match="cci:z_sym_triangle_bullet">
            &#8226;
            <xsl:value-of select="." />
        </xsl:template>
    
        <xsl:template match="text()">
            <xsl:value-of select="." />
        </xsl:template>
    </xsl:stylesheet>
    

    With that stylesheet Saxon 6.5.5 outputs the result

    <html>
       <p>OAKLAND, Calif. &#8212; A former student suspected of opening fire at a small Christian college in California, killing seven people
          and wounding three, was targeting a school administrator and former classmates who he felt had treated him unfairly, police
          said yesterday.
       </p>
       <p>Oakland Police Chief Howard Jordan said at a news conference that One Goh, 43, who had been expelled from Oikos University,
          had been cooperative with investigators after being taken into custody but &#8220;not particularly remorseful.&#8221;
       </p>
       <p>&#8220;We know that he came here with the intent of locating an administrator, and she was not here,&#8221; Jordan said. &#8220;He then went
          through the entire building systematically and randomly shooting victims.&#8221;
       </p>
       <p>The midmorning attack at Oikos, a small Oakland college that has links to the Korean-American Christian community, was the
          deadliest shooting rampage on a U.S. college campus since 
       </p>
    </html>
    

    for the input

    <cci:body class="element" displayname="body" name="body" xmlns:cci="urn:schemas-ccieurope.com" xmlns:ccix="http://www.ccieurope.com/xmlns/ccimlextensions">
        <cci:p>OAKLAND, Calif. — A former student suspected of opening fire at a small Christian college in California, killing seven people and wounding three, was targeting a school administrator and former classmates who he felt had treated him unfairly, police said yesterday.</cci:p>
        <cci:p>Oakland Police Chief Howard Jordan said at a news conference that One Goh, 43, who had been expelled from Oikos University, had been cooperative with investigators </cci:p>
        <cci:p ccix:annotation="insertion">after being taken into custody but “not particularly remorseful.”</cci:p>
        <cci:p>“We know that he came here with the intent of locating an administrator, and she was not here,” Jordan said. “He then went through the entire building systematically and randomly shooting victims.”</cci:p>
        <cci:p>The midmorning attack at Oikos, a small Oakland college that has links to the Korean-American Christian community, was the deadliest shooting rampage on a U.S. college campus since </cci:p>
    </cci:body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to list all content types (not nodes) that have a special field
I want to select all categories from a webservice. The webservice does not have
HI, I want to select all nodes other than first node.My xsl and xml
Simplified Question: What's the XPath to select all XML nodes with an attribute that
I want to select a node together with all child nodes from an XML
I want to to select all the nodes for a given id but that
I want to select all internal links, which are in my document, but not
Suppose I have a column called fruits I want to select all of the
I have two table emptable1(empid,status) emptable2(empid,week) i want to select all the empid whose
I'm creating the MaskedTextBox in WP7.1 In that i want to select all text

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.