当前位置: 动力学知识库 > 问答 > 编程问答 >

how to change xml dynamically in java?

问题描述:

I have written xml file which contains html tags as element like

<component>

<input type="button">

<button id="1">

<class="mytest1">

</component>

now i want to first write a html file with these tags like

<input type="button" class="mytest" id="1">

.and when i change button to text,in xml also it shud be change button to text.

网友答案:

Yes, use the Observer pattern.

Every time your HTML is changed, a method should be called which then processes the XML.

网友答案:

You could create a watch service, as shown here. The service will notify you of any changes and you can take the appropriate action.

分享给朋友:
您可能感兴趣的文章:
随机阅读: