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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:16:25+00:00 2026-06-01T22:16:25+00:00

I am using StAX to create a quite large xml document. Until now I

  • 0

I am using StAX to create a quite large xml document. Until now I was using the IndentingXMLStreamwriter class to get a well formatted document (see also this answer). A few days ago we setup a jenkins server with an older jdk version (6.26), on which i get build errors.

package com.sun.xml.internal.txw2.output does not exist

I assume the package cannot be found because of the installed jdk version. For different reasons this cannot be changed
(by the way, does anyone know the jdk version, at which this package (com.sun.xml.internal.txw2.output) was added?).
Therefore I am looking for an alternative to do the indenting. I would prefer a solution similar to the one I was using, which means without reparsing the document. Any ideas or suggestions?

Thanks
Lars

  • 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-01T22:16:26+00:00Added an answer on June 1, 2026 at 10:16 pm

    If other suggestions don’t work, you can get an indenting XMLStreamWriter from Saxon like this:

    Processor p = new net.sf.saxon.s9api.Processor();
    Serializer s = p.newSerializer();
    s.setOutputProperty(Property.METHOD, "xml");
    s.setOutputProperty(Property.INDENT, "yes");
    s.setOutputStream(....);
    XMLStreamWriter writer = s.getXMLStreamWriter();
    

    One advantage is that this allows you a lot of control over the serialization using other serialization properties.

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

Sidebar

Related Questions

I am using StAX to process a XML file. The document has a DOCTYPE
This is my program, I am using STAX Parser to parse an XML document
I am using StAX to construct an XML document using an XMLStreamWriter . However,
We are using StAX parser to read the large XML files and strip off
I'm using StAX in order to write an XML document but I can't find
Is it possible using StAX (specifically woodstox) to format the output xml with newlines
this is my first time using StAX for parsing XML documents (still in the
I'm using the StAX event based API's to modify an XML stream. The stream
I am trying to write XML data using Stax where the content itself is
I am using com.ctc.wstx.stax.WstxOutputFactory to generate XML. I am running wstx-asl-3.2.4 I need to

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.