Presenter:Mike Taulty
XML and Namespaces go together like Terry and June. In this session we'll look at how we can work with XML namespaces from VB using LINQ to XML
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
Alpines might Tolkien a little Microsoft in the UK and this is one of a series of short videos about the new technology that is coming with visual studio coping August August will be the next version of visual studio follows on from 2005 and the technology document in these sessions is one called language integrated query or link to XML what is essentially gives us a new language integrated query pattern on top of the new XML API that ships with visual studio coping August as part of the frame of 3 5 is one of a number of videos if you housing the video by creating XML querying XML it might make sense to look at those first in this field is taken very short at how we work with main spaces from XML perspective insider VB language were programming link to XML in the session and working with visual studio coping August is the large technology preview which was latest available version at the time
Minute 1
Caught on video and we have a simple council application in the p we ve added a reference to system xml link as an assembly in the league programme against link to XML and we did that in the previous session such as emergency muscular and right now is that little piece of VB which creates a single ex element at all brute who says that and then we run i e in order to display that if we run the physical reader as simple be selecting a everyone to this root element of the no specific names they thought we can do it VB is leading the attack on imports statement appear XML S will do that collects them key equals you N mine named us calm that imports statement on there and then little cutlass element here and as tightly on a press five and you ll see that
Minute 2
Not only have we dealt with putting this element into the namespace will also control the prefix was used to got into thatshould you care us to think what often you will really care about what prefixes rescues your eczema similarly everyone to add a secondso if we have imports must try anotherI don t recall that on cue and my other calm then we can go ahead and put into this piece of XML and element from Mattheware bad in there like that if we don t run there out then you can see me got that element living within thatis wealth so is very natural and in terms of using these import statements in order to control the namespace is abusing within a document in this woodwork with a creating XML whether we were generating and querying XML out everyone to control the default names that are a document than
Minute 3
We can do is take away our prefix of it from of p will come down here and just have route and on routes will have as you would expect it no less equals and all we have has called for what colourone Carmelite nun and will just take that he offer there and everyone that there was a final ID forthat document is now you endone we ve made that the default namespace naturally there and if we take the prefix away from my element than that element will now move into that particularpiquancy sweeping control the defaultor we can go ahead and have prefixes and controlis that way just as the Tory senior working with names races in VB ninth Wrexham rallies is pretty intuitive and very need we to have been you use of the imports statement that we already have to bring in CLR namespace
Minute 4
Now you can use it bringing success we can control the prefix which is assigned to them and I m just news that prefix in XML literals inside of the benign code if not controlled ifwe can just do that as we saw by typing in XML and less equals whatever your name is that it is on the particular elements where you want that and there is some more control you can get if you re not using the XML literal syntax if you re just falling back to using Excel and an exact reason someone in which case I would advise that you take a look at the corresponding video to see sharp where we walk through classes like ex name index namespace and Harry King users to control namespace is in the seashore language procedure the in built capabilities are in XML that VB 9 does such interested in how you do it without the XML literal syntax take a look at that see sharp recording proper stuff
Minute 5
Now widely it is once more a special link vulnerable and there s a great developer centre upon MSDN the URL is on screen and you ll find information there about all different aspects of link including a link to XML there s a good blog site of the linking action net I certainly been read by the number of articles from outside as a rates are to be aware of if you re interested in link out if you want to assess the questions are a user in the video feel free to mail me on my addresses as their on screen and active listening out to catch you out future events
Click here to go to original video page
Monday, July 21, 2008
Video: Namespaces in VB with LINQ to XML
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment