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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:06:44+00:00 2026-05-26T10:06:44+00:00

I am working with big and complex dictionary data (XML) which needs to be

  • 0

I am working with big and complex dictionary data (XML) which needs to be parsed by XSL and output XML.

what would be considered as a “best” way to test if XSL is processing all nodes from XML (input)?

please consider this simple example, i think it will represent nature of the problem:

input.xml

<?xml version="1.0" encoding="UTF-8"?>
<a>
   <b>
      <c>
         some1
         <d>text2</d>
         more text1
      </c>
   </b>
   <b>
      <c>
         some2
         <d>text2</d>
         more text2
      </c>
   </b>
   <d>text3</d>
   <e>
      text
      <d>4</d>
   </e>
</a>

some tarnsformations.xsl

output.xml

<?xml version="1.0" encoding="UTF-8"?>
<amodified>
   <bmodified>
      some1
      <dd>text2</dd>
      more text1
   </bmodified>
   <bmodified>
      some2
      <dd>text2</dd>
      more text2
   </bmodified>
   <dd>text3</dd>
   <ed>text</ed>
   <dd>4</dd>
</amodified>

In output.xml names of the tags have been changed as well as order of the content (comparing to input file).
I need to compare if all text fields from Input are available in output.
I think the best solution would be to creat test which will extract text from each tag and compare it string by string, outputing tags taht do not exist in output.xml to log file… ?

  • 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-26T10:06:44+00:00Added an answer on May 26, 2026 at 10:06 am

    I would recommend two kinds of tests: first a unit test on a smaller controlled set of data that is supposed to be a model for the data you find in your large dictionary. This could be considered a unit test for your xslt process. I usually would extract several representative pieces from the larger data set, and store these along with the test code. Then the test applies the transformation to the test data and makes assertions about the result, verifying that the transformation was successfully employed.

    Then additionally you should build sanity checks in to your production system so that (for example), you make sure that the total number of nodes processed corresponds to what you expect. For example, in a dictionary with a large number of entries, you could run one step to count all the entries, and then another one to process them. Then at the end, see how many entries you processed and make sure the count is the same as what you expected. This is also useful since it provides a means of outputting a progress bar (% complete).

    Anyway, that’s what we do.

    If the text in the output is the same as the text in the input, as in your example, Marcin, you can compare those fairly easily using xslt. If you process an xml file with an empty xslt stylesheet (just the <xslt:stylesheet /> node) then you will get back just the text, with no markup. I think xmllint can do this too. So just run that over both your input and output and compare using a simple text comparison (like diff).

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

Sidebar

Related Questions

I'm working on a big Qt application with multiple widgets which are quite complex.
I working with a big database what is the best way in performance -connected
I'm working with quite a big codebase which compiles fine in linux but vc++
The team I am working in has embraced scrum in a big way. I
I am working on a very big and complex application for Windows written in
I am working on big ASP.NET project(we using ASP.NET 3.5) which comprised of 5
So, I'm working on a Drupal 6 project that ultimately replaces a big, complex
I'm working on a big Java project which has been around for a while
Context I am working on a pretty complex web site framework which includes a
I'm working on a big flash site with lots of component swfs and a

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.