From: Peter N. <pet...@gm...> - 2007-03-19 07:07:22
|
Hello, someone on a different mailing list suggested vtd is a good tool for mapping GML to Java Objects. How is this done in detail? Are there any tutorials on this? Cheers, Pete |
From: Jimmy Z. <cra...@co...> - 2007-03-19 07:33:46
|
Can you provide a bit more details? For example, what is the starting point of your task? VTD-XML is a fast parser with built-in support for XPath ... If you have version 2.0, in it there are various short code examples to get you started... ----- Original Message ----- From: "Peter Neu" <pet...@gm...> To: <Vtd...@li...> Sent: Monday, March 19, 2007 12:06 AM Subject: [Vtd-xml-users] HowTo use Vtd for GML to Java Mapping? > Hello, > > someone on a different mailing list suggested vtd is a good tool for > mapping > GML to Java Objects. How is this done in detail? > Are there any tutorials on this? > > > Cheers, > Pete > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |
From: Tatu S. <cow...@ya...> - 2007-03-19 19:27:58
|
--- Peter Neu <pet...@gm...> wrote: > Hello, > > someone on a different mailing list suggested vtd is > a good tool for mapping > GML to Java Objects. How is this done in detail? > Are there any tutorials on this? Hmmh. This actually sounds like a strange piece of advice, depending on what "good" means. VTD does offer high performance for efficient tree-based access to xml content. But it does not (and is not meant to I think) offer any support for actual mapping between xml and Java. That's what data binding (and/or serialization) toolkits/libs offer. And on top of that, there isn't any specific support for GML, and likewise, that sounds like something to be done on higher level tools. VTD could of course be used as the underlying parser component for such tools. I don't know if there are such tools out there yet. As to binding data to Java objects, JAXB 2.0 is widely considered to be a good and reasonably fast library. As far as I know, it currently supports just SAX and StAX parsers under the hood. Since much of overhead is at binding level (constructing java objects, populating fileds), parser choice may not affect overall performance that much. So regarding goodness: if raw performance is the main goal, using VTD might make sense. If so, you would NOT want to map things to objects, but rather deal with raw xml entities directly. This would be a trade-off, and resulting code could very well be hard to use or understand, so its goodness would depend a lot on priorities. -+ Tatu +- ____________________________________________________________________________________ The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php |
From: Fernando G. <fer...@gm...> - 2007-03-20 09:44:18
|
As long as I know about GML files... It only defines data types to be used on your application specific schema. If you have a concrete application-specific schema, congratulations. Use a mapping tool like JAXB or Castor or whatever. If you haven't, you can't map because you don't have a schema to map. In this point I agree with Jimmy that you should use XPath to obtain the data of interest and I think VTD-XML is very useful. Fernando On 3/19/07, Tatu Saloranta <cow...@ya...> wrote: > > --- Peter Neu <pet...@gm...> wrote: > > > Hello, > > > > someone on a different mailing list suggested vtd is > > a good tool for mapping > > GML to Java Objects. How is this done in detail? > > Are there any tutorials on this? > > Hmmh. This actually sounds like a strange piece of > advice, depending on what "good" means. VTD does offer > high performance for efficient tree-based access to > xml content. But it does not (and is not meant to I > think) offer any support for actual mapping between > xml and Java. That's what data binding (and/or > serialization) toolkits/libs offer. And on top of > that, there isn't any specific support for GML, and > likewise, that sounds like something to be done on > higher level tools. > VTD could of course be used as the underlying parser > component for such tools. I don't know if there are > such tools out there yet. > > As to binding data to Java objects, JAXB 2.0 is widely > considered to be a good and reasonably fast library. > As far as I know, it currently supports just SAX and > StAX parsers under the hood. Since much of overhead is > at binding level (constructing java objects, > populating fileds), parser choice may not affect > overall performance that much. > > So regarding goodness: if raw performance is the main > goal, using VTD might make sense. If so, you would NOT > want to map things to objects, but rather deal with > raw xml entities directly. > This would be a trade-off, and resulting code could > very well be hard to use or understand, so its > goodness would depend a lot on priorities. > > -+ Tatu +- > > > > > > ____________________________________________________________________________________ > The fish are biting. > Get more visitors on your site using Yahoo! Search Marketing. > http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |
From: Tatu S. <cow...@ya...> - 2007-03-20 18:25:49
|
--- Fernando Gonzalez <fer...@gm...> wrote: > As long as I know about GML files... It only defines > data types to be used > on your application specific schema. If you have a > concrete > application-specific schema, congratulations. Use a > mapping tool like JAXB > or Castor or whatever. If you haven't, you can't map > because you don't have > a schema to map. In this point I agree with Jimmy Or equivalent object hierarchy... schema isn't strictly necessary, fortunatley. But object model has to exist and be (or made) compatible. JibX is another fine candidate. > that you should use XPath > to obtain the data of interest and I think VTD-XML > is very useful. I don't know anything about GML specifically, but point I tried to make is that the question was specifically (even if mistakenly) asking about xml/object mapping. Alternative to that may be using VTD-XML with xpath ("instead of object mapping, why not just directly exact data you need"). Just want to keep terminology accurate -- otherwise users expectations may not be met (if they really have object model as was implied). -+ Tatu +- ____________________________________________________________________________________ Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front |
From: Jimmy Z. <cra...@co...> - 2007-03-20 21:13:56
|
Exactly. Use XPath as a filter so that only the objects relevant to the application logic are created ... this way the object creation cost can be reduced significantly, making databind suitable for even very performance demand apps.... ----- Original Message ----- From: "Tatu Saloranta" <cow...@ya...> To: <vtd...@li...> Sent: Tuesday, March 20, 2007 11:25 AM Subject: Re: [Vtd-xml-users] HowTo use Vtd for GML to Java Mapping? > --- Fernando Gonzalez <fer...@gm...> wrote: > >> As long as I know about GML files... It only defines >> data types to be used >> on your application specific schema. If you have a >> concrete >> application-specific schema, congratulations. Use a >> mapping tool like JAXB >> or Castor or whatever. If you haven't, you can't map >> because you don't have >> a schema to map. In this point I agree with Jimmy > > Or equivalent object hierarchy... schema isn't > strictly necessary, fortunatley. > But object model has to exist and be (or made) > compatible. JibX is another fine candidate. > >> that you should use XPath >> to obtain the data of interest and I think VTD-XML >> is very useful. > > I don't know anything about GML specifically, but > point I tried to make is that the question was > specifically (even if mistakenly) asking about > xml/object mapping. Alternative to that may be using > VTD-XML with xpath ("instead of object mapping, why > not just directly exact data you need"). > Just want to keep terminology accurate -- otherwise > users expectations may not be met (if they really have > object model as was implied). > > -+ Tatu +- > > > > > ____________________________________________________________________________________ > Bored stiff? Loosen up... > Download and play hundreds of games for free on Yahoo! Games. > http://games.yahoo.com/games/front > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |