0

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.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by manikandan_dani
0

Hi!

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

Transformer transformer = TransformerFactory.newInstance().newTransformer();
       transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "your DTD  file name");
       transformer.transform(source, result);

Hope it will help you..

0

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:

<book id="b1">
 <bookbegin id="bb1">
    <para id="p1">This is<b>first</b>line</para>
    <para id="p2">This is<b>second</b>line</para>
    <para id="p3">This is<b>third</b>line</para>
 </bookbegin>
</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.

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.