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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:45:50+00:00 2026-06-07T19:45:50+00:00

I have an XML with a size ranging from 50k to about 300k, on

  • 0

I have an XML with a size ranging from 50k to about 300k, on which I need to make some transformations. The transformations include moving some elements to a different location and merging between the attributes of different elements.

For all I know, ideally I should use XSLT to perform this transformation, but I’m afraid it will create me tons of unnecessary work constructing the output XSL, as the number of required changes is negligible compared to the amount of data that stays exactly the same.

My questions:

  1. Would you recommend trying to do this raw using just DOM abilities (I work in .net 3.5) and some XPATH? The down size is that if the number of required changes increases it may add unnecessary complexity to the code.

  2. If you still recommend XSLT, is there some way in which I can just copy chunks from the input XML as are instead of recreating them from scratch?

Thank you!

  • 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-07T19:45:52+00:00Added an answer on June 7, 2026 at 7:45 pm

    Excellent question.

    It’s certainly true that XSLT can be expensive when you only want to make a very small change to a document. The cost is especially noticeable if you want to make lots of iterative transformations, which sometimes happens in optimization use-cases where each transformation creates a dataset that is a small improvement on the previous one.

    In many cases, however, the cost of making a small transformation is dominated by the parsing and serialization costs (converting lexical XML to a tree and back), so other approaches (e.g. DOM update or XQuery update) that also involve parsing and serialization are not going to be any better. So in answer to your question 1, I don’t think using DOM would be any better. The only real way to achieve an improvement is to use an XML database, whcih allows you to avoid the parsing and serialization cost because the document is now held persistently in tree form rather than lexical form.

    On your question 2, yes, you can copy chunks of the document unchanged using xsl:copy-of, and on any decent XSLT processor this should be very efficient. Certainly the cost of doing this copy from source tree to result tree is likely to be much less than the cost of parsing to construct the source tree, or serialization to dispose of the result tree. (Actual results, of course, will vary from one XSLT processor to another.)

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

Sidebar

Related Questions

HI I have an xml file with 500KB size which i need to send
I have an XML file which is about 200MB in size, i wish to
I have a bunch of XML files that are about 1-2 megabytes in size.
I have this XML file I need to extract the HTML Code from mono
I have an xml which contains some keywords. The format of the xml this:
I have an XML file (many MB in size), which I view using Notepad++.
I have an XML DataSource which feeds a repeater control. However, I'm having some
I have an XML file of size 31 GB. I need to find the
I have an xml file that is about 42k in size. Shouldn't tinyxml be
I have an XML file where I only care about the size attribute of

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.