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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:16:47+00:00 2026-05-26T15:16:47+00:00

Basically what’s happening is that the XML nodes themselves aren’t changing position. So I

  • 0

Basically what’s happening is that the XML nodes themselves aren’t changing position. So I figured my XSLT was missing something.

XSLT:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:asp="http://test.com/asp"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">

    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="root">
        <root>
            <xsl:apply-templates select="asp:TableRow">
                <xsl:sort select="@ID" data-type="text" order="ascending"/>
            </xsl:apply-templates>
        </root>
    </xsl:template>
</xsl:stylesheet>

XML:

<?xml version="1.0" encoding="utf-8"?>
<Root xmlns:asp="http://test.com/asp" xmlns:meta="http://test.com/meta" xmlns:cc1="http://test.com/cc1">
  <asp:TableRow ID="A02">
    <asp:TableCell>
      <asp:Localize ID="tagthreeCtrlNumberRes" meta:resourcekey="tagthreeCtrlNumberRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="tagthreeCtrlDescRes" meta:resourcekey="tagthreeCtrlDescRes" runat="server" />
      <asp:Localize ID="tagthreeCtrlNoteRes" meta:resourcekey="tagthreeCtrlNoteRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:RadioButtonList ID="rblthreeCtrlRes0" RepeatDirection="Horizontal" runat="server">
        <asp:ListItem Text="Yes" meta:resourcekey="rblthreeCtrl0Res0" Value="1" />
        <asp:ListItem Text="No" meta:resourcekey="rblthreeCtrl1Res0" Value="0" />
        <asp:ListItem Text="N/A" meta:resourcekey="rblthreeCtrl2Res0" Value="2" />
      </asp:RadioButtonList>
      <asp:RadioButtonList ID="rblthreeCtrlRes1" RepeatDirection="Horizontal" runat="server">
        <asp:ListItem Text="Yes" meta:resourcekey="rblthreeCtrl0Res1" Value="1" />
        <asp:ListItem Text="No" meta:resourcekey="rblthreeCtrl1Res1" Value="0" />
        <asp:ListItem Text="N/A" meta:resourcekey="rblthreeCtrl2Res1" Value="2" />
      </asp:RadioButtonList>
    </asp:TableCell>
    <asp:TableCell>
      <asp:Button ID="cmdthreeCtrlRes" meta:resourcekey="cmdthreeCtrlRes" runat="server" OnClick="FormDataSave_Click" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="lblAssmthreeCtrlRes" meta:resourcekey="lblAssmthreeCtrlRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="lblQualthreeCtrlRes" meta:resourcekey="lblQualthreeCtrlRes" runat="server" />
      <asp:Button ID="cmdQualAcceptthreeCtrlRes" meta:resourcekey="cmdQualAcceptthreeCtrlRes" OnClick="cmdQualAccept_Click" runat="server" Text="Accept" Visible="True" />
    </asp:TableCell>
    <asp:TableCell />
    <asp:TableCell />
  </asp:TableRow>
  <asp:TableRow ID="A01">
    <asp:TableCell>
      <asp:Localize ID="tagtwoCtrlNumberRes" meta:resourcekey="tagtwoCtrlNumberRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="tagtwoCtrlDescRes" meta:resourcekey="tagtwoCtrlDescRes" runat="server" />
      <asp:Localize ID="tagtwoCtrlNoteRes" meta:resourcekey="tagtwoCtrlNoteRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="tagtxttwoCtrlRes0" meta:resourcekey="tagtxttwoCtrlRes0" runat="server" />
      <asp:Textbox ID="txttwoCtrlRes0" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Button ID="cmdtwoCtrlRes" meta:resourcekey="cmdtwoCtrlRes" runat="server" OnClick="FormDataSave_Click" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="lblAssmtwoCtrlRes" meta:resourcekey="lblAssmtwoCtrlRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell />
    <asp:TableCell />
    <asp:TableCell />
  </asp:TableRow>
  <asp:TableRow ID="A03">
    <asp:TableCell>
      <asp:Localize ID="tagoneCtrlNumberRes" meta:resourcekey="tagoneCtrlNumberRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="tagoneCtrlDescRes" meta:resourcekey="tagoneCtrlDescRes" runat="server" />
      <asp:Localize ID="tagoneCtrlNoteRes" meta:resourcekey="tagoneCtrlNoteRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="tagtxtoneCtrlRes0" meta:resourcekey="tagtxtoneCtrlRes0" runat="server" />
      <asp:Textbox ID="txtoneCtrlRes0" runat="server" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Button ID="cmdoneCtrlRes" meta:resourcekey="cmdoneCtrlRes" runat="server" OnClick="FormDataSave_Click" />
    </asp:TableCell>
    <asp:TableCell>
      <asp:Localize ID="lblAssmoneCtrlRes" meta:resourcekey="lblAssmoneCtrlRes" runat="server" />
    </asp:TableCell>
    <asp:TableCell />
    <asp:TableCell />
    <asp:TableCell />
  </asp:TableRow>
</Root>

Code-behind:

For Each deleteChild As XmlNode In rootDoc.DocumentElement.ChildNodes
    rootDoc.DocumentElement.RemoveChild(deleteChild)
Next

'List (Of XMLNode)'
For Each markupElem As XmlElement In allNodes
    rootDoc.DocumentElement.AppendChild(markupElem)
Next

'List (Of XMLNode)'
For Each markupElem As XmlElement In nodesToMove
    rootDoc.DocumentElement.AppendChild(markupElem)
Next

Dim sortXmlDoc As Xsl.XslCompiledTransform = New Xsl.XslCompiledTransform(True)
sortXmlDoc.Load(xsltPath)

Dim saveWriter As XmlTextWriter = New XmlTextWriter(truePath, Nothing)
sortXmlDoc.Transform(rootDoc, saveWriter)
saveWriter.Close()
  • 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-26T15:16:47+00:00Added an answer on May 26, 2026 at 3:16 pm

    There are two obvious problem with the provided code:

    1. The only template in the code is matching root, but there is no root element at all in the provided XML element — therefore this template isn’t selected for execution at all.

    2. The elements in the provided XML document have no text nodes children. As there isn’t any other template in the provided XSLT code, only the built-in XSLT templates are used in processing the XML document. Their effect is to copy to the output only the text nodes — so nothing is produced as output.

    Solution:

    1. Change match='root' to match='Root'.

    2. Add the identity rule, so that every node will be copied.

    Having applied these two corrections to your code it becomes:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:asp="http://test.com/asp"
        xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    
        <xsl:output method="xml" indent="yes"/>
    
         <xsl:template match="node()|@*">
             <xsl:copy>
               <xsl:apply-templates select="node()|@*"/>
             </xsl:copy>
         </xsl:template>
    
        <xsl:template match="Root">
            <root>
                <xsl:apply-templates select="asp:TableRow">
                    <xsl:sort select="@ID" data-type="text" order="ascending"/>
                </xsl:apply-templates>
            </root>
        </xsl:template>
    </xsl:stylesheet>
    

    and when applied on the provided XML document:

    <Root xmlns:asp="http://test.com/asp" xmlns:meta="http://test.com/meta" xmlns:cc1="http://test.com/cc1">
      <asp:TableRow ID="A02">
        <asp:TableCell>
          <asp:Localize ID="tagthreeCtrlNumberRes" meta:resourcekey="tagthreeCtrlNumberRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagthreeCtrlDescRes" meta:resourcekey="tagthreeCtrlDescRes" runat="server" />
          <asp:Localize ID="tagthreeCtrlNoteRes" meta:resourcekey="tagthreeCtrlNoteRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:RadioButtonList ID="rblthreeCtrlRes0" RepeatDirection="Horizontal" runat="server">
            <asp:ListItem Text="Yes" meta:resourcekey="rblthreeCtrl0Res0" Value="1" />
            <asp:ListItem Text="No" meta:resourcekey="rblthreeCtrl1Res0" Value="0" />
            <asp:ListItem Text="N/A" meta:resourcekey="rblthreeCtrl2Res0" Value="2" />
          </asp:RadioButtonList>
          <asp:RadioButtonList ID="rblthreeCtrlRes1" RepeatDirection="Horizontal" runat="server">
            <asp:ListItem Text="Yes" meta:resourcekey="rblthreeCtrl0Res1" Value="1" />
            <asp:ListItem Text="No" meta:resourcekey="rblthreeCtrl1Res1" Value="0" />
            <asp:ListItem Text="N/A" meta:resourcekey="rblthreeCtrl2Res1" Value="2" />
          </asp:RadioButtonList>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Button ID="cmdthreeCtrlRes" meta:resourcekey="cmdthreeCtrlRes" runat="server" OnClick="FormDataSave_Click" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="lblAssmthreeCtrlRes" meta:resourcekey="lblAssmthreeCtrlRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="lblQualthreeCtrlRes" meta:resourcekey="lblQualthreeCtrlRes" runat="server" />
          <asp:Button ID="cmdQualAcceptthreeCtrlRes" meta:resourcekey="cmdQualAcceptthreeCtrlRes" OnClick="cmdQualAccept_Click" runat="server" Text="Accept" Visible="True" />
        </asp:TableCell>
        <asp:TableCell />
        <asp:TableCell />
      </asp:TableRow>
      <asp:TableRow ID="A01">
        <asp:TableCell>
          <asp:Localize ID="tagtwoCtrlNumberRes" meta:resourcekey="tagtwoCtrlNumberRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagtwoCtrlDescRes" meta:resourcekey="tagtwoCtrlDescRes" runat="server" />
          <asp:Localize ID="tagtwoCtrlNoteRes" meta:resourcekey="tagtwoCtrlNoteRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagtxttwoCtrlRes0" meta:resourcekey="tagtxttwoCtrlRes0" runat="server" />
          <asp:Textbox ID="txttwoCtrlRes0" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Button ID="cmdtwoCtrlRes" meta:resourcekey="cmdtwoCtrlRes" runat="server" OnClick="FormDataSave_Click" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="lblAssmtwoCtrlRes" meta:resourcekey="lblAssmtwoCtrlRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell />
        <asp:TableCell />
        <asp:TableCell />
      </asp:TableRow>
      <asp:TableRow ID="A03">
        <asp:TableCell>
          <asp:Localize ID="tagoneCtrlNumberRes" meta:resourcekey="tagoneCtrlNumberRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagoneCtrlDescRes" meta:resourcekey="tagoneCtrlDescRes" runat="server" />
          <asp:Localize ID="tagoneCtrlNoteRes" meta:resourcekey="tagoneCtrlNoteRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagtxtoneCtrlRes0" meta:resourcekey="tagtxtoneCtrlRes0" runat="server" />
          <asp:Textbox ID="txtoneCtrlRes0" runat="server" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Button ID="cmdoneCtrlRes" meta:resourcekey="cmdoneCtrlRes" runat="server" OnClick="FormDataSave_Click" />
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="lblAssmoneCtrlRes" meta:resourcekey="lblAssmoneCtrlRes" runat="server" />
        </asp:TableCell>
        <asp:TableCell />
        <asp:TableCell />
        <asp:TableCell />
      </asp:TableRow>
    </Root>
    

    the wanted, correct (sorted) result is produced:

    <?xml version="1.0" encoding="UTF-16"?>
    <root xmlns:asp="http://test.com/asp">
    <asp:TableRow ID="A01" xmlns:meta="http://test.com/meta" xmlns:cc1="http://test.com/cc1">
        <asp:TableCell>
          <asp:Localize ID="tagtwoCtrlNumberRes" meta:resourcekey="tagtwoCtrlNumberRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagtwoCtrlDescRes" meta:resourcekey="tagtwoCtrlDescRes" runat="server"></asp:Localize>
          <asp:Localize ID="tagtwoCtrlNoteRes" meta:resourcekey="tagtwoCtrlNoteRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagtxttwoCtrlRes0" meta:resourcekey="tagtxttwoCtrlRes0" runat="server"></asp:Localize>
          <asp:Textbox ID="txttwoCtrlRes0" runat="server"></asp:Textbox>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Button ID="cmdtwoCtrlRes" meta:resourcekey="cmdtwoCtrlRes" runat="server" OnClick="FormDataSave_Click"></asp:Button>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="lblAssmtwoCtrlRes" meta:resourcekey="lblAssmtwoCtrlRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell></asp:TableCell>
        <asp:TableCell></asp:TableCell>
        <asp:TableCell></asp:TableCell>
      </asp:TableRow>
    <asp:TableRow ID="A02" xmlns:meta="http://test.com/meta" xmlns:cc1="http://test.com/cc1">
        <asp:TableCell>
          <asp:Localize ID="tagthreeCtrlNumberRes" meta:resourcekey="tagthreeCtrlNumberRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagthreeCtrlDescRes" meta:resourcekey="tagthreeCtrlDescRes" runat="server"></asp:Localize>
          <asp:Localize ID="tagthreeCtrlNoteRes" meta:resourcekey="tagthreeCtrlNoteRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell>
          <asp:RadioButtonList ID="rblthreeCtrlRes0" RepeatDirection="Horizontal" runat="server">
            <asp:ListItem Text="Yes" meta:resourcekey="rblthreeCtrl0Res0" Value="1"></asp:ListItem>
            <asp:ListItem Text="No" meta:resourcekey="rblthreeCtrl1Res0" Value="0"></asp:ListItem>
            <asp:ListItem Text="N/A" meta:resourcekey="rblthreeCtrl2Res0" Value="2"></asp:ListItem>
          </asp:RadioButtonList>
          <asp:RadioButtonList ID="rblthreeCtrlRes1" RepeatDirection="Horizontal" runat="server">
            <asp:ListItem Text="Yes" meta:resourcekey="rblthreeCtrl0Res1" Value="1"></asp:ListItem>
            <asp:ListItem Text="No" meta:resourcekey="rblthreeCtrl1Res1" Value="0"></asp:ListItem>
            <asp:ListItem Text="N/A" meta:resourcekey="rblthreeCtrl2Res1" Value="2"></asp:ListItem>
          </asp:RadioButtonList>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Button ID="cmdthreeCtrlRes" meta:resourcekey="cmdthreeCtrlRes" runat="server" OnClick="FormDataSave_Click"></asp:Button>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="lblAssmthreeCtrlRes" meta:resourcekey="lblAssmthreeCtrlRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="lblQualthreeCtrlRes" meta:resourcekey="lblQualthreeCtrlRes" runat="server"></asp:Localize>
          <asp:Button ID="cmdQualAcceptthreeCtrlRes" meta:resourcekey="cmdQualAcceptthreeCtrlRes" OnClick="cmdQualAccept_Click" runat="server" Text="Accept" Visible="True"></asp:Button>
        </asp:TableCell>
        <asp:TableCell></asp:TableCell>
        <asp:TableCell></asp:TableCell>
      </asp:TableRow>
    <asp:TableRow ID="A03" xmlns:meta="http://test.com/meta" xmlns:cc1="http://test.com/cc1">
        <asp:TableCell>
          <asp:Localize ID="tagoneCtrlNumberRes" meta:resourcekey="tagoneCtrlNumberRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagoneCtrlDescRes" meta:resourcekey="tagoneCtrlDescRes" runat="server"></asp:Localize>
          <asp:Localize ID="tagoneCtrlNoteRes" meta:resourcekey="tagoneCtrlNoteRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="tagtxtoneCtrlRes0" meta:resourcekey="tagtxtoneCtrlRes0" runat="server"></asp:Localize>
          <asp:Textbox ID="txtoneCtrlRes0" runat="server"></asp:Textbox>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Button ID="cmdoneCtrlRes" meta:resourcekey="cmdoneCtrlRes" runat="server" OnClick="FormDataSave_Click"></asp:Button>
        </asp:TableCell>
        <asp:TableCell>
          <asp:Localize ID="lblAssmoneCtrlRes" meta:resourcekey="lblAssmoneCtrlRes" runat="server"></asp:Localize>
        </asp:TableCell>
        <asp:TableCell></asp:TableCell>
        <asp:TableCell></asp:TableCell>
        <asp:TableCell></asp:TableCell>
      </asp:TableRow>
    </root>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I wrote a script that generates a xml file based on user input.
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I’ve heard that certain conditions will cause .NET to blow past the finally
Basically I'm trying to accomplish the same thing that mailto:bgates@microsoft.com does in Internet Explorer
Basically from a database I am getting data that is formatted like this nameofproject101
Basically I have an iframe loaded that is accessed from the parent whenever it
Basically I just need the effect of copying that HTML from browser window and
Basically we've noticed that on some computers setting the JVM option -Xmx (max heap
Basically I have a single element inside of an xml file where I store
Basically, I have a main page (parent page) with a link that opens up

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.