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 actually want to set the namespace resultion withing this function to the given argument.
Look at this article, he does exactly what I want, but I am sure that in VB.NET XML Literals there is a much nicer way than doing it the hardcoded way.
I know I can simply do it like this:
element.Elements([namespace] + "Property").Remove()
But I was wondering if there is a way to include namespaces in VB.NET amazing .<>
, .@
, ...<>
language shortcuts.