July 2015
Intermediate to advanced
1300 pages
87h 27m
English
With embedded expressions, you can include local variables or perform dynamic queries within XML literals. Let’s look again at the first example about XML literals, where an XML document contains a couple of contacts. Imagine you want to generate a contact starting from some variables (that you could populate at runtime with different values) instead of hard-coding the last name, first name, and age. This can be accomplished as follows:
'All with type inferenceDim FirstName = "Alessandro"Dim LastName = "Del Sole"Dim Age = 37Dim Contacts = <?xml version="1.0"?> <Contacts> <Contact LastName=<%= LastName %> FirstName=<%= FirstName %> Age=<%= ...