943,083 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 454
  • Java RSS
Jan 30th, 2010
0

XML Editor in java

Expand Post »
Hi,
I am developing xml editor using jsp and servlet. In this case i am using DOM parser. using that i getting all the element, text, xpath form xml file with help of DTD.

Upto this it will be working, and it save back into xml file.
While save into xml file, <!DOCTYPE construct SYSTEM "c:/xmleditor/dtd/xConStruct.dtd"> this line deleted, This is my problem.please help me.

thank in advance.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
manikandan_dani is offline Offline
17 posts
since Jan 2010
Jan 30th, 2010
0

Re:

Hi!

you have to include this line while you are saving the xml file...

Java Syntax (Toggle Plain Text)
  1. Transformer transformer = TransformerFactory.newInstance().newTransformer();
  2. transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "your DTD file name");
  3. transformer.transform(source, result);


Hope it will help you..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
indu_ss4 is offline Offline
22 posts
since Jan 2010
Feb 1st, 2010
0
Re: XML Editor in java
Thanks!
It is working..

I have another problem in XML editor using java(jsp,servlet),
How to edit the following xml file without losing elements.
eg:
xml Syntax (Toggle Plain Text)
  1. <book id="b1">
  2. <bookbegin id="bb1">
  3. <para id="p1">This is<b>first</b>line</para>
  4. <para id="p2">This is<b>second</b>line</para>
  5. <para id="p3">This is<b>third</b>line</para>
  6. </bookbegin>
  7. </book>
I try to edit the above xml file using dtd using jsp,servlet. but while i read the textvalue from xml, it return only first,second,third.How to read the 'This is' and 'line '. Then how to store back to the xml file using xpath.

thank in advance.
Last edited by adatapost; Feb 1st, 2010 at 2:31 am. Reason: Added [code] tags. Encase your code in: [code] and [/code] tags.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
manikandan_dani is offline Offline
17 posts
since Jan 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: HELP ! I don't know how to fix this error! Help
Next Thread in Java Forum Timeline: Java OSX Library Issues.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC