S
Sony Antony
We have a situation wherin we should translate the incoming XML based
on one schema to the outgoing XML that is based on another schema.
Since both input and output are both XML, XSLT was the natural
preference.
But there was a requirement that demanded a part of the generated XML
to be different depending on whether an element was present or not in
the incoming XML. Since we were only beginning with XML, we couldn t
find the Xpath xsl:if combination that will generate this logic. ( Can
somebody help me here, though that is not the main topic of this
posting )
So somebody came up with JAXB. We changed the program so that the
incoming XML was converted to Java objects using JAXB. Then there was
the ‘if' statement in java and the result was converted to XML again
using JAXB.
At this time this was thought to be an inefficient ad hoc way of
getting the task done. But then I read more about JAXB and came to
know that JAXB generated code can be as fast as a SAX parser.
Now it appears to me that XSLT might be using DOM parser internally
and that it might be actually slower than the JAXB way.
I know I should do an actual performance comparison to reach any
conclusions. But can somebody theoretically compare which of these
methods will be faster.
Thanks a lot for reading
--sony
on one schema to the outgoing XML that is based on another schema.
Since both input and output are both XML, XSLT was the natural
preference.
But there was a requirement that demanded a part of the generated XML
to be different depending on whether an element was present or not in
the incoming XML. Since we were only beginning with XML, we couldn t
find the Xpath xsl:if combination that will generate this logic. ( Can
somebody help me here, though that is not the main topic of this
posting )
So somebody came up with JAXB. We changed the program so that the
incoming XML was converted to Java objects using JAXB. Then there was
the ‘if' statement in java and the result was converted to XML again
using JAXB.
At this time this was thought to be an inefficient ad hoc way of
getting the task done. But then I read more about JAXB and came to
know that JAXB generated code can be as fast as a SAX parser.
Now it appears to me that XSLT might be using DOM parser internally
and that it might be actually slower than the JAXB way.
I know I should do an actual performance comparison to reach any
conclusions. But can somebody theoretically compare which of these
methods will be faster.
Thanks a lot for reading
--sony