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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:18:07+00:00 2026-05-19T17:18:07+00:00

This is similar question with few differences : Split XML file into multiple files

  • 0

This is similar question with few differences :

Split XML file into multiple files based on a threshold value

My root element is called stores, and elements to split are called store. And I want to do this from java with xsl or without, here is my java code which I used to trigger the xsl :

public void transform(String transformator, File source, String destination) {
    try {    
        TransformerFactory tFactory = TransformerFactory.newInstance();

        Transformer transformer = tFactory.newTransformer(new StreamSource(transformatorLocation));

        try {
            transformer.transform(new StreamSource(new InputStreamReader(new FileInputStream(source), "UTF-8")), new StreamResult(new OutputStreamWriter(new FileOutputStream(destination), "UTF-8")));
        } catch (TransformerException e) {
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            System.err.println("File is missing");
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    } catch (TransformerConfigurationException e) {
        e.printStackTrace();
    }
}

I’ve tried both solutions in this question, but they both produce erros, one is :

ERROR: ‘Unsupported XSL element ‘http://www.w3.org/1999/XSL/Transform:for-each-group”
javax.xml.transform.TransformerException: java.lang.RuntimeException: Unsupported XSL element ‘http://www.w3.org/1999/XSL/Transform:for-each-group‘

Other is that style sheet can’t be compiled.

What I try to accomplish ? Pass argument to java class how many stores do I want in one file, and split it into n parts.

  • 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-19T17:18:08+00:00Added an answer on May 19, 2026 at 5:18 pm

    I believe that for-each-group is an XSLT 2.0 construct. The default XSLT processors in java do not yet support XSLT 2.0.

    You either need to stick with XSLT 1.0, or find a XSLT processor that does 2.0, and use that instead (for example, Saxon).

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

Sidebar

Related Questions

I've seen a few similar questions to this one, but none that were quite
This is similar to this question , but I want to include the path
This question was inspired by a similar question: How does delete[] know the size
Similar question as this one but for a Microsoft Environment. Email --> Exchange Server
I asked a similar question about this previously, but I did not specify that
I know this is similar to this question , but I'm using SQL Server
I have a similar question to this one SQL products/productsales I want to do
Liu Chang asked a very similar question to this one here, Linux equivalent of
This is similar to a previous question , but the answers there don't satisfy
Similar to this question , after running the following code the browser dialog does

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.