Can we insert a new node or edit an XML document using SAX
Paser? If yes how?

Answers were Sorted based on User's Feedback



Can we insert a new node or edit an XML document using SAX Paser? If yes how?..

Answer / upender

No it is not possible with SAX parser.. In case of DOM
parser a memory tree is formed which is alterable and
subsequently mapped to XML document

Is This Answer Correct ?    3 Yes 2 No

Can we insert a new node or edit an XML document using SAX Paser? If yes how?..

Answer / g.h

You could say it is not IMpossible. It just depends on how
the parser is used.

Suppose we made a SAX handler which basically outputs XML
that copies the input being parsed. The handler could be
programmed in such a way that it outputs an additional node
at the right moment. It could also make changes in between
input and output.

However, SAX is not really intended for such operations. We
are not really altering the XML document itself either. SAX
merely reads the XMl text and generates events based on the
input. What we do with those events depends on what the SAX
parser is used for.

If new nodes must be inserted, multiple edits made or
content moved around, the natural fit is DOM: the Document
Object Model. It models an XML document entirely in memory
as an object tree, allowing unlimited alterations. If
necessary, this model can then be outputted to a text-based
XML form again.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More XML XSLT RSS Interview Questions

Can I use xml namespaces in dtds?

0 Answers  


I have to do an overview of xml for my manager/client/investor/advisor. What should I mention?

0 Answers  


how can I handle embedded html in my xml ?

0 Answers  


What is rss service on my phone?

0 Answers  


How does stylesheet effects the overall template?

0 Answers  






What is dtd used for?

0 Answers  


How is xsl different from cascading style sheets? Why is a new stylesheet language needed?

0 Answers  


How do I convert a pdf to a zip file?

0 Answers  


What is a file feed?

0 Answers  


Is xml meant to be a replacement of html?

0 Answers  


What is a podcast rss feed?

0 Answers  


What is XSLT stylesheet?

0 Answers  


Categories