xml-literals

Using strings in XML Literals

Hi, I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me. I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument I have 2 questions, the second regarding a workaround due to my inability to figure ...

How to prevent HTML encoding for embedded expressions in XML Literals (VB.NET)?

With the following code: Dim x As System.Xml.Linq.XElement = _ <div> <%= message.ToString() %> </div> Dim m = x.ToString() ...if message is HTML, then the < and > characters get converted to &lt; and &rt;. How can I force it to skip this encoding? ...

How do I create a strongly typed view page using ASP.NET MVC VB.NET XML Literals View Engine?

I am using the ASP.NET MVC VB.NET XML Literals View Engine created by Dmitry Robsman and described on his blog in this post. http://blogs.msdn.com/dmitryr/archive/2008/12/29/asp-net-mvc-view-engine-using-vb-net-xml-literals.aspx I would like to create strongly typed view pages using this view engine, but it doesn't seem to contain the ...

Recursion with XML Literals in VB.NET is possible?

I have a class called Profile that has some simple properties and then it can have a collection of ProfileItem that again has some simple properties and then it can have a collection of ProfileItem (RECURSION). Now I am trying to generated a very simple save function using XML Literals that come with VB.NET (3.5). The code I am using i...

IntelliSense in VB Xml literals

Hi, is there a way to enable IntelliSense for XML literals in VB9 (VS 2008)? The ideal source of IntelliSense is an XSD document, but I can use anything else format to do it. Thanks ...

VB.NET XML Literals Parsing

If I have a text stored in db, file, resource does not matter: <code><%= Integer.MaxValue %></code> Is there a way to do this: Dim el As XElement = XElement.Parse({variable containing text above}) and to have it evaluate the expression Integer.MaxValue? ...

Is there a way to use XML Literals to view results of a Web Service call?

I'm finding this post very useful.. http://stackoverflow.com/questions/102084/hidden-features-of-vb-net XML literals seem to be very powerful.. I'm wondering if there's any way to use them to view the results of a Web Service Call in .Net? ...

XML Literal with Linq statement

I am going to be performing an XSLT transformation, transforming XML to an HTML table. It's tabular data, so that's why I'm not using div's. ;) Anyway, I need to repeat one part of the XSLT for the size of one of my collections. Here's a snippet of the code... Dim styleSheet = <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet ver...

Conditional XML Literal

I've tried searching on this but can't seem to find an answer anywhere, so hopefully someone here can help. I want to insert an conditional XML tag based on whether or not a count is above one, but am not sure how to do it. For example, I have two XElements that are like this: <Blob> <Group> Stuff 1 </Group> </Blob> and <Blob> <Gro...

XLinq with encrypted files?

How do I create/read/write XLinq and/or VB XML Literals from and to encrypted xml files? ...

Writing XML Exactly as XML Literals are Written

I'm transforming some XML from DrawingML to XAML. Unfortunately, the XAML one is not working as expected with white spaces, but I have found a work around. Here's the problem: Problem Statment I want to write the following in a TextBlock: Hi John, what did Sushi A say to Sushi B? So I would write: <TextBlock> <Run>Hey</Run> ...

Why Don't Dynamic XML Literals Inherit Default Namespace

I have an XElement that I need to create via dynamic xml literals/embedded expressions and I need it to inherit the default namespace. This doesn't appear possible though through everything I've tried. Does anyone know how to make this work? For example Imports <xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt; Sub ...

XML literals in JavaScript?

E4X (Ecma-357) is an extension to ECMAScript that adds XML literals as first-class primitives. That's awesome, but with only Mozilla and Adobe support (without V8 and IE support too), E4X is virtually dead from a web developer's perspective that has to support users with any modern browser. What other work is being done around implemen...

VB.NET XML Literal Expression Expected with Linq to XML

I have the same problem as stated in this question, but the accepted solution there was a "works on my machine" answer. Here is my code: Dim document As XDocument = _ <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="h...

How can I embed XElements into XML literals in VB.NET?

In VB.NET I can easily embed strings into XML literals using <xml><%= "my string" %></xml>. How can I embed an XElement instance? I know I can use methods on the XElement, XNode, etc classes, but I'd like to do it in the XML literals if possible. ...

How to dynamically set local XML namespace?

I have several xml namespaces that expose the same schema. I want to use a function that dynamically accepts a namespace and applies the attributes or the properties according to the specified namespace: Public Sub ProcessElement(element As XElement, [namespace] As XNamespace) element.<[namespace]:Property>.Remove() End Sub I actua...

LINQ to SQL to XML (using XML literals in C#)

Is it possible to use variables like <%=person.LastName %> in XML string this way? XElement letters = new XElement("Letters"); XElement xperson = XElement.Parse("<Table><Row><Cell><Text> <Segment>Dear <%=person.Title%> <%=person.FirstName%> <%=person.LastName%>, </Segment></Text></Cell></Row>..."); foreach (Person person in pers...

Programming Languages that support XML literals

What are all the programming languages that support XML literals natively or via extension? I know of VB.NET, Scala, and Factor. Any others? ...