Document object delimiters (at parse time)

Posted on 2006-04-23
Last Modified: 2010-03-31
Is there a way to add some delimiters(for example: to trim off the whitespaces and the newlines) to a Document object. I would like to do it at parse time, what would the code look like to add this functionality.

private static Document document;
private static DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(new File(args[0]));
Question by:no158
    LVL 92

    Expert Comment

    not that I know of.

    Author Comment

    is there any way triming off the whitespaces and newlines at any point?
    LVL 92

    Accepted Solution

    you could iterate thru the tree once its loaded

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    NotAlone Challenge 20 65
    Problem to setup 18 67
    wordsFront challenge 8 48
    solarwind tftp server 2 18
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now