Results 1 to 4 of 4
Thread: Plain text from XML
- 05-14-2012, 09:26 AM #1
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
Plain text from XML
Hi all,
can somebody help? I wanna extract palaintext from XML (DOM or SAX, not tokenizing from FileReader) with tags how I see it in source.
Let's say nodeList.item(0)= <node1>
<node1>
<child>
<body><P>TEXT</P></body>
</child>
</node1>
Result:
String str= "<child><body><P>TEXT</P></body></child>"
Thanks in advance
- 05-14-2012, 10:55 AM #2
Re: Plain text from XML
Moved from Advanced Java.
Forum Rules
Guide For New Members
BB Code List - Java Programming Forum
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-14-2012, 12:15 PM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Plain text from XML
You'll want a Transformer (TransformerFactory.getInstance().getTransformer()).
Then setOutputProperty for OutputKeys.OMIT_XML_DECLARATION and probably OutputKeys.ENCODING, then transform the Node you're interested in.Please do not ask for code as refusal often offends.
- 05-14-2012, 02:27 PM #4
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Scanning a Plain text file
By aw249 in forum New To JavaReplies: 3Last Post: 02-03-2012, 05:16 PM -
plain text printing with java
By berkeleybross in forum Advanced JavaReplies: 3Last Post: 04-04-2011, 01:01 AM -
Combobox from plain text file (plain text file database)
By cotarelo in forum AWT / SwingReplies: 3Last Post: 06-08-2010, 08:10 PM -
Indentation - plain text
By barney75 in forum New To JavaReplies: 1Last Post: 03-23-2009, 05:54 PM -
convert html to plain text
By vissu007 in forum New To JavaReplies: 3Last Post: 07-07-2007, 02:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks