Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Badass: Making Users Awesome
this week in the
XML and Related Technologies
xml ingore whitespace
Joined: May 20, 2008
Feb 15, 2011 18:36:42
i am using :
docFactory = DocumentBuilderFactory.newInstance();
docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.parse(xsltFile);
but it does not ingore the white space, i do not want to remove all space manually , can anyone give me a solution
Joined: Oct 14, 2005
Feb 15, 2011 20:29:00
Whitespace is only "ignorable" if you have a schema which describes the document. (Your code doesn't validate, so you don't have a schema.) Otherwise there is no way for the parser to tell which whitespace you are not interested in.
I agree. Here's the link:
subject: xml ingore whitespace
empty text nodes
Ignoring whitespace in character data
Need help for Shell Script to reduce a file
NMTOKENS (supports seperation with tabs, CRs, extra whitespaces OR not?)
Subtle, subtle, little Log4j difficulty
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015