0

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.

3
  • 1
    what library are you using for the reading? Commented Mar 21, 2012 at 8:06
  • @Eshika : Could you clarify the question a bit more? Did you 'programmatically'? Commented Mar 21, 2012 at 8:42
  • @Adam,I am using DOM Parser to read one by one element. Commented Mar 21, 2012 at 8:53

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

6 Comments

I think that the HTML is already being parsed by his application, so, he wouldn't need a watch service.
@DhaivatPandya: The watch service will tell him when the XML/HTML files have been changed. It does not do any parsing.
I know, but, if he's already got a variable containing the HTML, you wouldn't want to watch the file, you might as well watch that variable.
@DhaivatPandya: What you are saying does make sense to a certain point. That being said, the OP mentioned files, not variables.
Thanks to both of you.But my problem is that i have written xml file which contains html tags as element like<component><input type="button"><button id="1"><class="mytest1">,now i want to first write a html file with these tags like <input type="button" class="mytest" id="1">.I hope u understood my point.and when i change button to text,in xml also it shud be change button to text.
|
0

Yes, use the Observer pattern.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.