vBulletin FAQ
The website where you learn about vBulletin Forums
Home   Download vBulletin   vBulletin FAQ Forums vBulletin Related Sites Contact Us
Welcome to vBulletin FAQ

vBulletin FAQ Navigation

Getting Started

Customizing your vBulletin

Search Engines & SEO

Making Money with a Forum

Promoting your Community

Get your own vBulletin Today


Webmaster Help


.NET and XML





vBulletin Book Store > vBulletin books beginning with .

More details of book titled: .NET and XML

.NET and XML

Author: Niel M. Bornstein
Published: 2003-07
List price: $39.95
Our price: $30.36
Usually ships in 24 hours
As of: November 20th, 2008 12:59:01 PM
Customer comments on this selection.

vBulletin Hardly a Java book!
A careful reader would have noticed the "using" keyword in the code sample, and realized that this is C#, not Java. I found this book a good supplement to the MSDN; its well-conceived examples got me off to a good start in this area.

vBulletin aaaarrrrggggg Who wants java examples in a .net book
i was looking for example on using the System.xml.serialize name space. This is the example copied from the book br /public enum AddressType { br / Home, br / Office, br / Billing, br / Shipping, br / Mailing, br / Day, br / Evening, br / FAX br /} br /If you'll look again at Example 9-7, you'll see that each state is actually listed by its full name, not the abbreviation as listed in the State enumeration. Here I've added an XmlEnumAttribute for each state name. Note that I've skipped some in the interest of space: br / br /public enum State { br / [XmlEnum(Name="Alaska")] br / AK, br / [XmlEnum(Name="Alabama")] br / AL, br / [XmlEnum(Name="Arkansas")] br / AR, br / [XmlEnum(Name="Arizona")] br / AZ, br /// ... br / [XmlEnum(Name="Washington")] br / WA, br / [XmlEnum(Name="Wisconsin")] br / WI, br / [XmlEnum(Name="West Virginia")] br / WV, br / [XmlEnum(Name="Wyoming")] br / WY br /} br /The Address class has one attribute, type, and four elements. Here I've added XmlAttributeAttribute and XmlElementAttribute, as appropriate. The AttributeName and ElementName fields of each attribute are used to set the names of the XML attributes and elements, respectively: br / br /public class Address { br / [XmlAttribute(AttributeName="type")] br / public AddressType AddressType; br / [XmlElement(ElementName="street")] br / public string[ ] Street; br / [XmlElement(ElementName="city")] br / public string City; br / [XmlElement(ElementName="state")] br / public State State; br / [XmlElement(ElementName="zip")] br / public string Zip; br /} br /Similar to Address, the TelephoneNumber class has one attribute and three elements. Again, I've decorated each member with the appropriate attribute. Note also that here, as in Address, I've set the names of the attributes and elements to match the ones in the XML; that is, they all start with lowercase letters: br / br /public class TelephoneNumber { br / [XmlAttribute(AttributeName="type")] br / public AddressType AddressType; br / [XmlElement(ElementName="areacode")] br / public string AreaCode; br / [XmlElement(ElementName="exchange")] br / public string Exchange; br / [XmlElement(ElementName="number")] br / public string Number; br /} br /Now we come to the meat of the personnel record, the Employee. This class has three attributes: firstname, middleinitial, and lastname, which I've treated with the appropriate attribute. However, the Employee class also has two additional elements, addresses and telephones. These two elements actually contain nested arrays of elements, so I've used the XmlArray and XmlArrayItem attributes to help the serializer figure out what to do with the XML elements it reads: br / br /public class Employee { br / [XmlAttribute(AttributeName="firstname")] br / public string FirstName; br / [XmlAttribute(AttributeName="middleinitial")] br / public string MiddleInitial; br / [XmlAttribute(AttributeName="lastname")] br / public string LastName; br / br / [XmlArray(ElementName="addresses")] br / [XmlArrayItem(ElementName="address")] br / public Address [ ] Addresses; br / [XmlArray(ElementName="telephones")] br / [XmlArrayItem(ElementName="telephone")] br / public TelephoneNumber [ ] TelephoneNumbers; br / br / [XmlAttribute(AttributeName="hiredate")] br / public DateTime HireDate; br /} br /Here's the document element, personnel, which is decorated with XmlRootAttribute. Although the Employees member is an array of Employee objects, it is not a nested array, like addresses and telephones. By adding the XmlElement attribute directly to the member, the XmlSerializer knows that this member is to be serialized as an array of employee elements, without a separate top-level element: br / br /[XmlRoot(ElementName="personnel")] br /public class Personnel { br / [XmlElement(ElementName="employee")] br / public Employee [ ] Employees; br /} br /Finally, I've made some changes to the Serializer class, which I introduced in Example 9-5. Serializer's Main( ) method still uses the CreatePersonnel( ) to create some personnel records, but it then instantiates an XmlSerializer to deserialize the objects it created back out to a file: br / br /public class Serializer { br / public static void Main(string [ ] args) { br / Personnel personnel = CreatePersonnel( ); br / XmlSerializer serializer = new XmlSerializer(typeof(Personnel)); br / using (FileStream stream = File.OpenWrite("Personnel.xml")) { br / serializer.Serialize(stream,personnel); br / } br / } br /} br / br /notice its in java??? for crying out loud if your going to say .net and xml use .net examples not JAVA

vBulletin Very Disappointed
Note that I decided to write this review because I could not believe that so many people wrote so nice reviews about this book. My assumption is that someone or some people are really trying to sell this book, because this book is definitely not that good whatsoever. br / br /Actually, this book is definitely not what I expected from a .NET/XML book. I was expecting a practical book with some theory, a good description about .NET's XML implementation and good examples. This is not what this book included. I'm very flexible with books. It's impossible that every book will be perfect. Actually, most aren't, so you have to get used to it, but again this book is for the most part terrible, unless you only want to get a general idea of how to use XML with .NET, otherwise get a different book. Again, I don't know where the reviews for this book came from, because this book is really not that good. br / br /To name a couple of things that I find wrong with the book, lets start with the examples included. Two words: they suck! Each chapter is pretty much like this: here is the general theory, some of it unnecessary like the constant reference to W3C stuff; then, here are a few lame, simple examples without much substance; now, lets go to the next chapter. br / br /The first time I looked inside the book I was looking for information about how .NET did Xml Validation, and it is just terrible. I actually found more information out of general .NET books I already had, than from this one. And when you are working on a project where you need this information, and you have a book that's suppose to help you with this stuff, it is very disappointing to find out that the book is pretty much irrelevant. br / br /You would assume validation is a very important XML topic, among many others, but there's really not a lot of info on it. Actually, if you look on the book's index, you'll see that about half the related info is in the reference section, which you could get out of MSDN anyway. BTW, almost half of the book is simply reference for the different .NET XML namespaces. Again, the same data you could get out of MSDN. br / br /In any case, I know there's not much else to choose from, but pretty much anything else might be as good or possibly way better...

vBulletin Just what I was looking for!
Over the years, I've found it increasingly difficult to buy technology related books simply because of the speed in which they become obsolete. So now I look at each book as not only an instructional tome, but whether or not it will be useful 6 months down the road as a reference. This book (like many of O'Reilly's titles) has easily earned a place in my library. br / br /Mr. Bornstein's method of writing seems to fit very well with the way I learn, and his coverage of the subject matter makes this book a great resource when I'm trying to remember the exact syntax of a specific method call.

vBulletin Solid introduction with a light reference section
This book has probably all you need to know about reading, writing, formatting and sending XML over the wire with C#. Standout chapters for me were chapters seven, on XSLT, and nine, on web services. That being said all of the non-reference chapters were evenly written, easy reads and neither rat hole nor pander to the reader. The code samples are numerous but they are hilighted with bold to emphasizes the portions that a critical to the narrative.pC# is the only imperative language covered in the book even though most .NET authors cover both C# and VB.NET. In the introduction the author calls C# the central language of .NET and says it's the best language for the job. I don't have big issues about that but other potential .NET readers may, especially considering the popularity of VB.NET. Personally I prefer when the author chooses one language and then leaves the other to the site or the CD. I think VB.NET example code fragments on the O'Reilly site probably would have been a safer bet.pIt's this one language approach in the dual language .NET environment that kicks the rating from five down to four.

Our vBulletin book picks:


Find more vBulletin related products of interest.

Search:
Keywords:
Amazon Logo

Purchase vBulletin - Site Map - vBulletin Forum
Copyright © 2006 vBulletin-FAQ.com. All rights reserved.
This website is not affilliated with Jelsoft or vBulletin.
Forums - Archive