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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:43:44+00:00 2026-06-11T15:43:44+00:00

I am struggling with understanding an XSLT transformation. Currently I receive a serialized object

  • 0

I am struggling with understanding an XSLT transformation. Currently I receive a serialized object in XML format, then apply XSLT and send new XML back the program. But now I need to eliminate XSLT step and to do the transformation internally in the program. The problem is I’ve seen XSLT sheet for the second time. Transformation sheet look really simmple but I still cannot undersnad what is going on there.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://tempuri.org/">
  <xsl:output omit-xml-declaration="yes" indent="yes"/>
  <xsl:strip-space elements="*"/>
  <xsl:template name="CopyEverything" match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="/t:Data/Flagged">
    <xsl:element name="Flagged">
      <xsl:apply-templates select="/t:Data/Covers/node()|@*"/>
    </xsl:element>
  </xsl:template>
  <xsl:template match="/t:Data/FlaggedDetails">
    <xsl:element name="FlaggedDetails">
      <xsl:apply-templates select="/t:Data/TotalFlaggedDetails/node()|@*"/>
    </xsl:element>
  </xsl:template>
  <xsl:template match="/t:Data/System/RArray">
    <xsl:element name="{local-name()}">
      <xsl:for-each select="/t:Data/System/RArray/Elem">
        <xsl:call-template name="CopyEverything"/>
      </xsl:for-each>
      <xsl:for-each select="/t:Data/Elem/Elem">
        <xsl:variable name="currentCode" select="Code" />
        <xsl:variable name="showAlways" select="ShowAlways" />
        <xsl:if test="count(/t:Data/System/RArray/Elem[Code=$currentCode])=0">
          <xsl:call-template name="CopyEverything"/>
        </xsl:if>
      </xsl:for-each>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

As far as I understand something from Data/Flagged and Data/FlaggedDetails is copied to Data/System/RArray, I cannot translate this logic to C#. I have to eliminate serialization stemps, so I move objects between collections (if this is what is going on) without XSLT. Could someone help me on this?

  • 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-11T15:43:45+00:00Added an answer on June 11, 2026 at 3:43 pm

    I wouldn’t advise “translating” an XSLT transformation into C# due to many reasons:

    This isn’t always easy due to the incompatibilities between the two languages:

    1. Think how to simulate templates and match patterns in C# ?

    2. How to simulate the XSLT processing model?

    3. How to simulate importing stylesheet modules and determining which are the objects with highest import precedence?

    4. How to simulate keys?

    5. You will have to implement in C# a number of useful XPath (and XSLT) standard functions — all the string functions, such as translate(), normalize-space(), substring-before(), substring-after(), …, etc.

    6. Instructions such as <xsl:number> and functions such as format-number().

    So, if you have the time needed to invest in all this and the result is successful (which is not too-likely), the translation would be several times longer than the original and in most cases — completely not-understandable, not extensible, not maintainable.

    I also doubt that a translation would run significantly faster than the original — it can run slower in some cases (for example, not implementing keys efficiently).

    Conclusion: I strongly advise against engaging in such destructive activity.

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

Sidebar

Related Questions

I'm struggling big time understanding how to use the DOMElement object in PHP. I
I am currently struggling with the correct data format to use with Cassandra. I
I'm new to writing web services, and am struggling with understanding how to specify
I am really struggling with understanding the difference between these two. From my textbook,
I'm looking into the memory model a little more and am struggling with understanding
I am struggling understanding what a clustered index in SQL Server 2005 is. I
I am still struggling with understanding classes, I am not certain but I have
I'm struggling a bit with understanding default scopes and named scopes with my quiz
I am struggling with an issue certainly due my lack of understanding on the
I am really struggling with understanding how you are loose coupling your app with

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.