From: Jimmy Z. <cra...@co...> - 2007-01-23 19:59:39
|
Yes, that can be done... the issue is whether that should be part of the core API... this is how you can do it <test attr1= "a1" attr2="a2" /> Since VTD-XML offers a flat view of the tokens, once you get to the "test" element, corresponding to index value of i, then if there are two attr names, the indices would be i+1, i+3, both of which has the token type of attr_name, or attr_ns, and of the same depth as the token i.... once you have the index value for attr names, call vn.toString(i+1) vn.toString(i+3) will get you the string values... ----- Original Message ----- From: "Atzmon Hen-Tov" <at...@po...> To: "Jimmy Zhang" <cra...@co...> Sent: Monday, January 22, 2007 10:49 PM Subject: RE: [Vtd-xml-users] xerces discussion on VTD Re "core API", is there a way to get the names of all attributes on the current element? Suppose I don't know which attributes to expect... -----Original Message----- From: vtd...@li... [mailto:vtd...@li...] On Behalf Of Jimmy Zhang Sent: Tuesday, January 23, 2007 6:42 AM To: Tatu Saloranta; Boris Kolpackov Cc: vtd...@li... Subject: Re: [Vtd-xml-users] xerces discussion on VTD There has been quite a few people saying that XML's many use case do not involve schema.. Do you feel JDOM is easy use... I don't know because while performance and memory can be measured, ease of use is usually a matter of opinion (even religion)... my own take: there is not much in JDOM that is Java specific, one can probably create some sort of C# DOM which retains the features of JDOM... again, I am personally still seeking inputs on the core API of VTD-XML and my own view on ease of use of VTD-XML is biased ... :) ----- Original Message ----- From: "Tatu Saloranta" <cow...@ya...> To: "Jimmy Zhang" <cra...@co...>; "Boris Kolpackov" <bo...@co...> Cc: <vtd...@li...> Sent: Monday, January 22, 2007 3:43 PM Subject: Re: [Vtd-xml-users] xerces discussion on VTD > --- Jimmy Zhang <cra...@co...> wrote: > >> A few things about this default element/attribute >> val feature in schema at >> the moment >> >> 1. This feature is not really about validation > > Right. It is one of ill-defined features of W3C Schema > (IMO), and was probably added to make it easier to > transition from DTDs, as DTD allows attribute > defaulting. Thank god Schema didn't port over general > entities, though. > > There's a term to describe result of Schema validated > document, with possible augmentations (PSVI, > Post-Schema-Validation Infoset?). > >> 2. it seems more like a way to modify the XML >> structure. >> >> do you see this as an essential feature of XSD? > > Although I can't answer for Boris, I assume it all > depends on use cases. For some use cases and users it > may, for others not. > But more than this, whether those use cases are core > use cases for VTD. > > I have said this before, but I think there is value in > knowing exactly where and to whom VTD could add most > value. Whether it eventually gets used for wide-range > of tasks or not, there are some areas where it seems > more optimal than others. And from that one could ask > the question: "does Schema in general matter for [core > use cases]; and if it does, is attribute defaulting > used for them". > > From my perspective, VTD's main potential benefit is > its speed. But for many Schema-dependant use cases, > users do not care (or are ignorant). > I have seen enough developers write code where they > convert from Strings to JDOM trees and back, happily > using convenience methods to construct dynamic xpath > expression all over the place, that I honestly do not > think most developers care. Even by just properly > using existing tools they'd get significant > improvements. > For them, it all comes down to perceived simplicity of > API. Usually they are pretty happy when they see, say, > XOM, after using DOM for a while. > > And then there are other use cases where performance > does matter, and people are willing to invest time in > understanding new tools and learning new APIs. That's > where solutions like VTD may come in handy. > > -+ Tatu +- > > > > > ________________________________________________________________________ ____________ > Expecting? Get great news right away with email Auto-Check. > Try the Yahoo! Mail Beta. > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html > ------------------------------------------------------------------------ - 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=DEVDE V _______________________________________________ Vtd-xml-users mailing list Vtd...@li... https://lists.sourceforge.net/lists/listinfo/vtd-xml-users |