• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Simple, but Possible? IgnoreWhiteSpace!

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question may be asked several times, but I want to find whether there is a wrok around for it.
A very simple documemt like this:


After it is parsed by DOMParser, <A> will have 3 children (2 of them are just #text node). Now, if I do not have a DTD, is there any quick way to NOT include these two #text node in final DOM? setIgnoreWhitespace() simply does not work!
I do not want 2 #text nodes in my parsed document.
Thanks for any helps!
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think there is without a DTD, you need it to know whether or not the whitespace is in fact ignorable. How much control do you have over the format it comes in? Could you safely make an assumption that all nodes that contain only whitespace are ignorable for example?
 
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic