Hi Alex,

Thanks for the quick reponse.

Well, I was able to conclude these things from your mail

1.DOM is better than SAX.
2.The initialisation is not needed if we not using namespace.
3.XML difference has to be implemented by us, there is no straight forward 
approach to do this.

Just one thing is not clear
Which one should I use out of these 2 Xalan DOM or Xerces DOM ? For just XML 
parsing ?

Thanks
-Praveen

-----Original Message-----
From: Axel Wei� [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 28, 2005 5:21 PM
To: [email protected]
Subject: Re: Xerces/Xalan DOM which one should I use?

Am Donnerstag, 28. April 2005 12:32 schrieb
[EMAIL PROTECTED]:
> Hi,
>
> I have couple of questions regarding Xerces and Xalan
>
> First one is why do we have to use these lines , whats the importance
> of usign it ? Is this compulsory
>
>     XALAN_USING_XALAN(XalanDocument)
>     XALAN_USING_XALAN(XPathEvaluator)
>     XALAN_USING_XERCES(XMLPlatformUtils)
>     XALAN_USING_XERCES(MemBufInputSource)
>     XALAN_USING_XALAN(XalanDOMString)
>     XALAN_USING_XALAN(XalanNode)
>     XALAN_USING_XALAN(XalanSourceTreeInit)
>     XALAN_USING_XALAN(XalanSourceTreeDOMSupport)
>     XALAN_USING_XALAN(XalanSourceTreeParserLiaison)
>     XALAN_USING_XALAN(XObjectPtr)
>     XALAN_USING_XALAN(NodeRefList)
>     XALAN_USING_XERCES(LocalFileInputSource)

Hi Praveen,

these macros are wrappers for the 'using'-directive, if namespaces are 
supported by your compiler, empty otherwise.

>
> Second One ,
>
> We are tryign to write a program to perform following things 1. We
> want to get the value of each tag , modify an XML tag if necessary ,
> delete an XML tag and store it back to the same XML file.

Generally, in-file manipulations are a bad idea. You should consider processing 
the source file read-only first, and store the results in a different tempfile. 
As a second step, you can move the tempfile to the name of the original source.

> 2. I need to do an XML transformation.

This is what xalan is for.

> 3. I need to do an XML validation.

Validation is a matter of enabling validation during parsing. There is no 
method similar to 'validate this piece of XML'.

> 4. I need to find the difference between two XML files. It could in
> ordered or unordered.

This task can become rather difficult!

> 1. In the second case what and all need to be initialised ?
>
> 2. Are there any API's to find the difference between two XML files or
> do I have to perform these things on my own.

There is no standard describing the difference between two XML files. In fact, 
you can choose rather different measures about what counts as a difference and 
what does not. In the simplest case, you run 'diff' and get the text-based 
differences - but this might not be what you intend.
In all other cases you have to compare two representations (e.g. DOM
trees) against each others and find the differences according to your preferred 
rules.

> 3. Should I use DOM or SAX ?

In order to perform a rule-based content difference checker, I would prefer 
DOM, since the algorithms can be recursive, and you can formulate just any 
rules. (But I may be wrong here, because I have only little experience with 
SAX).

> 4. I heard both Xalan DOM and Xerces DOM is present , Which one should
> I use ?
>
> 5. How to use only Xerces DOM or only Xalan DOM ?

If you want to perform XML-stylesheet processing, there is no need to program 
it again. You can use the Xalan executable as a simple transformation tool.

On the other hand, if your application is required to perform stylesheet 
processing by it's own, there is no need to use a second DOM representation. 
Xalan accepts both DOM variants as input.

> 6. Is Memory Manager necessary ? if yes please provide me the sample
> code on how to use it ?

It's not necessary to use a custom MemoryManager, as memory management falls 
back to stdlib-behaviour. However, if you encounter performance issues, 
MemoryManager may help you.


--
Humboldt-Universit�t zu Berlin
Institut f�r Informatik
Signalverarbeitung und Mustererkennung
Dipl.-Inf. Axel Wei�
Rudower Chaussee 25
12489 Berlin-Adlershof
+49-30-2093-3050
** www.freesp.de **

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to