You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Timm, Sean" <st...@gohealthcast.com> on 2000/07/31 21:00:48 UTC

RE: Getting the JAXP reference implementation to work with Xalan. ..

How about option #4: Since Xerces is already a JAXP implementation, just use
that.  :)

- Sean T.

-----Original Message-----
From: Brian Young [mailto:Brian.Young@sas.com]
Sent: Monday, July 31, 2000 12:26 PM
To: 'xalan-dev@xml.apache.org'
Subject: Getting the JAXP reference implementation to work with Xalan...


Hello,

I am working on an application that persists its data as XML.  Code is
already in place using Sun's JAXP reference implementation of an XML parser
to persist and restore this XML.  I am tasked with writing XSLT to transform
this XML into a JSP.  I chose to use Xalan as my XSL processor, as Sun
doesn't have one ready in the time-frame that I need to finish my work.
I've gotten the transformation of the XML to JSP working, but only from a
separate VM.  It is, at this time, using the default Xerces XML parser.

When I try to get the JAXP reference implementation jars (jaxp.jar and
parser.jar) and the Xalan/Xerces jars (notably xerces.jar) to co-exist in
the VM (my application running) I end up with the XML persistence code that
should use the JAXP reference implementation trying to use Xerces instead.
I imagine there are conflicts from trying to have all the jars in the same
VM.

I'm mulling over my options, and would like your input.

1)  Make JAXP reference implementation and Xerces exist together peacefully
and each only be used when appropriate (JAXP reference for the XML
persistence/restoration, Xerces for the transformation to JSP).  Is this
possible?

2)  Convert the XML persistence/restoration over to use Xerces.  Right now,
the tree that is parsed is a DOM Level 1 tree, not the DOM Level 2 that
Xerces likes.  Is that an issue, or will Xerces handle down-level DOM Levels
greacefully?  Also there is a significant bit of resistance to do this, as
this existing code is stable and working to specification.

3)  Make the XML to JSP code use the JAXP reference implementation rather
than Xerces.  It is my understanding that I need to provide a liaison
implementation in order to accomplish this.  Does a liaison to the JAXP
reference implementation exist yet?  How daunting is such a task?  Lastly,
where can one find documentation on the class and interface that must be
implemented?  The JavaDoc of those is not enough for me to go by, I'm
afraid.

Any thoughts are greatly appreciated.  I'm trying to use Xalan v1.1.D01, by
the way.

Thanks,
   Brian Young

XSLT without DOM tree

Posted by Paulo Gaspar <pa...@krankikom.de>.
Remember M$ was talking about XSLT without DOM tree?


On new XSLT ideas and XML interfaces, just check the 
"XmlNavigator" idea on:
  http://msdn.microsoft.com/voices/xml07242000.asp

  <quote>
  XMLNavigator provides a "cursor" or "iterator" over 
  any XML tree, and methods for moving around the tree
  </quote>

Some methods:
  MoveToNext, MoveToPrevious, 
  MoveToParent, MoveToFirstChild, 
  MoveToAttribute, 
  Insert, Move, Remove, 
  CopyChildren,
  Select,
  Matches...

Another idea:
  <quote>
  XmlNavigator class can navigate any XML, not just the 
  in-memory DOM tree.
  </quote>

And from here... it gets really weird. Remember that M$
was thinking about implementing XSLT without DOM???
Well, that does NOT mean it is a SAX source either:
  <quote>
  ...by providing an XmlNavigator subclass called 
  DataDocumentNavigator, which can navigate relational 
  tables, rows, and columns stored in an ADO+ DataSet...
  </quote>
  <quote>
  The XmlNavigator class's XPath support also allows you 
  to provide input to the XslTransform class. Plug in 
  the DataDocumentNavigator, and you will quickly see 
  that you can now transform relational data with XSLT
  just as easily as you can transform the contents of an
  XmlDocument object.
  </quote>


And what about a XmlNavigator cursor parsing a large text 
file forward and backwards?
(Yeah... why not parsing backards? Even with some sparse
bookmarks or indexing helping a bit?)


Have fun,
Paulo Gaspar

Re: Getting the JAXP reference implementation to work with Xalan...

Posted by Gary L Peskin <ga...@firstech.com>.
Brian --

It seems like Sean's option 4 is the same as your option 2.  There
shouldn't be any problem switching from JAXP to Xerces since Xerces
should implement all of the same methods as JAXP.  You might just give
it a quick try.  Switching the .jar files and maybe fixing up the
original instantiation of the parser should be all that is required.

It would be nice if someone did create a liaison class for JAXP and
contributed it.  I'd do it myself except I don't use JAXP and I'm
focusing on studying the 2.0 extension mechanism with the hopes of
jazzing that up a bit.  Looking at the source for XercesLiaison class,
it doesn't seem like coding a JAXP liaison class should be too daunting
(says he who's not volunteering to do the work).  This source should
have been downloaded with your .zip file and is available online from
the CVS repository.

If a JAXP liaison is something you really need, let me know and give me
a ballpark timeframe (> yesterday).  I'll download JAXP and see about
converting my stuff to temporarily use it and create a liaison in the
meantime.  I'd like to see Xalan work with all of the XML parsers out
there.

Gary

"Timm, Sean" wrote:
> 
> How about option #4: Since Xerces is already a JAXP implementation, just use
> that.  :)
> 
> - Sean T.
> 
> -----Original Message-----
> From: Brian Young [mailto:Brian.Young@sas.com]
> Sent: Monday, July 31, 2000 12:26 PM
> To: 'xalan-dev@xml.apache.org'
> Subject: Getting the JAXP reference implementation to work with Xalan...
> 
> Hello,
> 
> I am working on an application that persists its data as XML.  Code is
> already in place using Sun's JAXP reference implementation of an XML parser
> to persist and restore this XML.  I am tasked with writing XSLT to transform
> this XML into a JSP.  I chose to use Xalan as my XSL processor, as Sun
> doesn't have one ready in the time-frame that I need to finish my work.
> I've gotten the transformation of the XML to JSP working, but only from a
> separate VM.  It is, at this time, using the default Xerces XML parser.
> 
> When I try to get the JAXP reference implementation jars (jaxp.jar and
> parser.jar) and the Xalan/Xerces jars (notably xerces.jar) to co-exist in
> the VM (my application running) I end up with the XML persistence code that
> should use the JAXP reference implementation trying to use Xerces instead.
> I imagine there are conflicts from trying to have all the jars in the same
> VM.
> 
> I'm mulling over my options, and would like your input.
> 
> 1)  Make JAXP reference implementation and Xerces exist together peacefully
> and each only be used when appropriate (JAXP reference for the XML
> persistence/restoration, Xerces for the transformation to JSP).  Is this
> possible?
> 
> 2)  Convert the XML persistence/restoration over to use Xerces.  Right now,
> the tree that is parsed is a DOM Level 1 tree, not the DOM Level 2 that
> Xerces likes.  Is that an issue, or will Xerces handle down-level DOM Levels
> greacefully?  Also there is a significant bit of resistance to do this, as
> this existing code is stable and working to specification.
> 
> 3)  Make the XML to JSP code use the JAXP reference implementation rather
> than Xerces.  It is my understanding that I need to provide a liaison
> implementation in order to accomplish this.  Does a liaison to the JAXP
> reference implementation exist yet?  How daunting is such a task?  Lastly,
> where can one find documentation on the class and interface that must be
> implemented?  The JavaDoc of those is not enough for me to go by, I'm
> afraid.
> 
> Any thoughts are greatly appreciated.  I'm trying to use Xalan v1.1.D01, by
> the way.
> 
> Thanks,
>    Brian Young