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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:46:52+00:00 2026-05-23T00:46:52+00:00

I am inserting a new element into an existing xml, I get my xpaths

  • 0

I am inserting a new element into an existing xml, I get my xpaths (where the element should be inserted) in an xml file, so I wrote a program that generates the XSLT script according to that input. Now whenever I am running it, it adds the elements to some xpaths and ignores the rest, I included all the namespaces that are being used, but what it’s doing is that it’s going to a certain hierarchy level and it doesn’t go past it, at least this is what I am seeing. here is a snippet of the code for two templates one that inserts the element and the other that does not insert the element at all. Please tell me what I am doing wrong in here..

These are the templates that I can add due to the size:

        <xsl:copy>
            <flag sender="me" recipient="you" issueDateTime="02/14/2011">
                <flagSubject> Error </flagSubject>
                <message>
                    <p>r5 Designator Text is empty    </p>
                </message>
            </flag>
            <xsl:apply-templates select="@*| node()"/>
        </xsl:copy>
    </xsl:template>

        <xsl:copy>
            <flag sender="me" recipient="you" issueDateTime="02/14/2011">
                <flagSubject> Error </flagSubject>
                <message>
                    <p>r7 default title is blank    </p>
                </message>
            </flag>
            <xsl:apply-templates select="@*| node()"/>
        </xsl:copy>
    </xsl:template>

        <xsl:copy>
            <flag sender="me" recipient="you" issueDateTime="02/14/2011">
                <flagSubject> Error </flagSubject>
                <message>
                    <p>r7 default title is blank    </p>
                </message>
            </flag>
            <xsl:apply-templates select="@*| node()"/>
        </xsl:copy>
    </xsl:template>

        <xsl:copy>
            <flag sender="me" recipient="you" issueDateTime="02/14/2011">
                <flagSubject> Error </flagSubject>
                <message>
                    <p>r5 Designator Text is empty    </p>
                </message>
            </flag>
            <xsl:apply-templates select="@*| node()"/>
        </xsl:copy>
    </xsl:template>

        <xsl:copy>
            <flag sender="me" recipient="you" issueDateTime="02/14/2011">
                <flagSubject> Error </flagSubject>
                <message>
                    <p>r7 default title is blank    </p>
                </message>
            </flag>
            <xsl:apply-templates select="@*| node()"/>
        </xsl:copy>
    </xsl:template>
  • 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-05-23T00:46:53+00:00Added an answer on May 23, 2026 at 12:46 am

    here is a snippet of the code for two
    templates one that inserts the element
    and the other that does not insert the
    element at all. Please tell me what I
    am doing wrong in here..

    In the provided code there are two templates each overriding the identity rule/template for particular elements.

    The fact that the first template “does not insert the element at all” means that there isn’t any node that matches the match-pattern of this template.

    If you provide the source XML document many people will show you that there isn’t any such element in this XML document.

    In case there are actually more templates (which you haven’t shown), then another possible reason is that another template that also matches such elements was chosen due to higher priority — and this other template probably doesn’t do anything that would produce output.

    The second template, in contrast, obviously matches element(s) from the source XML document and it does what it is intended to do.

    Summary: The most likely problem with the first template is that it doesn’t match any node in the XML document.

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

Sidebar

Related Questions

I was trying to insert new data into an existing XML file, but it's
So the main program is in C#. Inserting new records into a VFP database
I'm inserting an img tag into my document with the new Element constructor like
Does std::map move around already inserted values when inserting new data ?
I am inserting 2-dimensional array references into my heap in Perl. How should I
I'm creating a new XDocument and inserting a root element profiles in it, then
I am inserting new elements into a database where the primarry key is a
Short version: After inserting a select element with options into the DOM with an
After inserting new html to DOM,I need to add some listeners to it. But
Is there a way to enforce constraint checking in MSSQL only when inserting new

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.