Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.
2008-12-13
To use variable values in your XML, use <%= and %> as delimiter. Example:
Dim X = “Hello!”
MessageBox.Show(<myXmlElement><%= X %></myXmlElement>.ToString())
Imagine the help you get from this when you are sending HTML code to the web browser in an ASP.NET application. Finally, if you need a variable that represents some XML data, the name of the type is XElement in System.Xml.Linq. XElement has a simple API to manipulate and query the XML data.
Dim MyData = <SomeData><Child>1</Child><Child>2</Child></SomeData>
MessageBox.Show(MyData.Nodes().Count().ToString())
Categories: Visual Basic 9
Tags: XML
Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!
Leave a Reply