Presenter:Mike Taulty
VB9 becomes the best .NET language for creating and manipulating XML with XML features built natively in the language. In this session, we'll take a quick look at what you can expect.
The following text is a software generated transcript of the video. Click on a minute link to jump to a location within the video
Minute 0
Hello and welcome to stop in the discussion is one in a series of short videos would spend time looking at how to do things with visual studio net framework minus m Tolkien I work in the developer and platform group in Microsoft in the UK and it is one of a number of sessions about Visual Basic nine that a future version of the VB language if you want to search the web for this the best centre uses language integrated query or link with acute information VB 9 in a set shall take a look at the XML support dirt in built into the VB 9 language and its pretty radical stance of us get straight on at a pioneering visual studio 2005 I have been a preview of the link technologies which gives the preview VB 9 compiler now one of the technologies in that preview is excellent XML language integrated query will advocate that he but that is some classes that come with excellent replying with XML
Minute 1
Though in the simplest case the Avenue class called on an ex element so I won t declare myself a new ex element and it lies in a nice way s nice glasses and supporting them building up and querying XML so let s say I want to play with some books or something like that until the books document so go ahead and declare myself annex element and a wild as a driver back to the console by getting the exile from it and that it can give me that I could strain there are lots of things we can do with this ex element class I have look at all the members hear you say we can add things to even work out things on expat axes like ancestors and descendants and so on and so forth lots of things we can do is classroom to explore all of it here let s kick off by creating a simple XML document if we run this program you can see the recreated am an XML document with books is a know to their so critical pretty easy if I
Minute 2
Absent content into my books element in the way that seems to work with the ex element class as I can go ahead and use different constructor with some content so what I can do is add in here and new ex element that have won for book and if I want to add volatility for that like that s the minute that is popular and little three books into Iraq s element go ahead from pileup now we ve got three books in books element so was not on to fasten far let s go ahead and anthem attributes into each one of these book and elements of his creatives will go ahead and add and ex attributes in here s contents were go ahead and call the swan and title boats have great expectations will have to wander across online year software and have another
Minute 3
New ex attribute here so what will do although they disastrously better since it onto says another actuaries are not saying that no of Lucullus Price will have that s five pounds 55 and will go ahead in house another except really are too many races but have also begins and referring that embraces the match opinion in product terms that from this something might write letters if we can that it occurred so dizzy reset something at now on our first book other two books having anything in their boat easily were building XML here is the vexed elements for attributes is very logical son of hierarchical model as the Howard of investing up recently very well and into details of two more books to avoid watching the type played so well back and without a
Minute 4
More books than every gunmen programmes it is to get a slightly larger XML document and it doesn t look too bad very neat way of doing a XML that will make it better and little while after Middlesbrough Heritage is quickly queried this stuff so let s imagine that I wanted to query this XML and bring out the price of each books with God in their something is gone like myself are free sure strife reach would like to pull out and let s call it brought as ex element and one of a series query into ex and get all the descendants that children plus descendants kind of thing the record book that gives as an ex element of reach one of those what will do the console write line with the book am going to ask if is attribute called price but very simple and forgotten on that then we get the price of three different books coming at
Minute 5
Go again pretty easy way to query the XML is well and is probably pointing out that we can t just get the attributes who we can go ahead and get ancestors looking attributes we can get descendants we can go ahead and get notes before this note after this and so on a sofa at these of various axes that you will see in the expat specification of the navigating around an XML document so in this offensive things that are VB actually has built in support for XML based around these new classes that you see on the screen examines and so on that makes this even nicer than what looking at right now so we can go ahead and do this or we can go ahead and is something which is functionally equivalent to a
Minute 6
Can t comment out the second and will do it will go ahead in dinner eight X as ex element again but I already do is go ahead and say we got books and we have a book I don t only remember me the details here and we had an all suddenly as well and is constructing XML writing a reliant and forgot are run that as it stands right now you can see that were still pulling out priced five pounds 55 it is really really cool ban which is putting the XML rightly in line and using it in a very natural way and the nice thing to know is that this isn t really magic is empty what s going on is that the compiler is doing this kind of work for is a making article look at that but if we just switch to reflect that is a
Minute 7
In we can see that the compiler is essentially creating an exam and call books cultivating ex names for us with an ex element for booking it never got this object array and we can see that s been created with the next attributes price five pounds 55 and so on and so forth the compiler is doing this work throws without having to do it is was great so once again let s just go and expand this out visit the video where we copy and paste to get more books and were back where we were set now very much neater looking piece of code with some XML if you might literally embedded into it and the ghastly Volkswagen place a figure I had a run family back to where we were and we could relax months in way so that is one side of XML supporting VB 9 and if that we can probably just pull at this as its element here and allow VB to infer the type of the right hand side nuptials that work for us if you seen them near the video we did about implicit
Minute 8
Do you understand how that works and how this is not to combine together but there s another clever thing of the readers and built in support for querying and along these axes that we thought her descendants and ancestors and so on their three he axes that VB already understands and has syntax for that s the child access that is the descendants access and that is the attribute access is it already understand how to do this so what only well essentially what he can do instead of writing here books attribute fries or we can do is read and write at book dart price value so ie pull out the price actually from the book government must consider that still works and it does in works at the same way as we have before so that s really we also understand the descendants accessing satirising ex descendants book I can write a
Minute 9
doc book which too many dot dot dot dot book and if you are rerun and was still getting the same result as we are before we are having to know about them descendants and so on we can also understand the child access so just to illustrate their lives go to our first book here and inside let other child elements will add publisher our port made up publisher has had a version of it publishes its books at with added a publisher there what we can do here is also gone right out console that right line but I don t book a publisher value better run than any can see them again in the value of the publisher out of maximum element to this is very cool week and directly navigating to attributes we can directly navigate into children and we can directly navigate into
Minute 10
Descendants with built in syntax and the language bringing that an gap that exists in XML and the managers can closing at more than ever before so totally agree that while Savona played with a slightly in this session this is neater than what we started with this is neater than what we started with we get a really rich syntax retracting with XML from the day I d urge you to go and take a look at what we can do with XML and CV with his ex element ex attribute and so on classes and the inbuilt language support because it s really rich just as the light was seen in the short session whilst we can t cover off everything about XML and VB 9 you ve seen that we have some new glasses are playing with XML specifically ex element ex attribute and so on we looked at the right code explicitly those things and build up some simple XML content that any thought that was VB 9 we could do a lot further by embedding the little XML
Minute 11
It into the language syntax it was still causing the same code to be written it would have been written in an easy way which is always a benefit we also saw that the specific axis or expat axes as we think of them specifically the actually axis the descendants axis in the child axis which he directs intact again in the language the querying XML rather than having to call methods in order to make that happen in the real power of all the stuff comes in when you start out into excellent 12 querying available talk about excellent in subsequent sessions but the features of his show he today pretty much stand on their own fridge acting with XML in VB 9 wedding Yugoslav or information on VB 9 and language integrated query whether the site of an MSDN agency link there on the screen and off that site you ll find a document that talks about the changes in the VB 9 language that forthcoming perhaps it is not finished yet at the
Minute 12
Change and if you think that on this particular sessions are free to mail me on just might uphold the Microsoft com the councillors and council watching the session and abstract
Click here to go to original video page
Wednesday, July 23, 2008
Video: VB9 - XML Support
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment