bytecode77
bytecode77

Reputation: 14820

XDocument: Create custom declaration

I want to create Windows Media Player playlist files with XDocument. Therefore I have to create this declaration:

<?wpl version="1.0"?>

However, the XDeclaration object doesn't allow to replace "xml" with "wpl". Is there a proper way to handle this?

Upvotes: 1

Views: 321

Answers (1)

Tomalak
Tomalak

Reputation: 338178

That's a processing instruction, not an XML declaration.

new XProcessingInstruction("wpl", "version=\"1.0\"")

Your document is still an XML document, so you can additionally include <?xml version="1.0"?> at the top, but that's optional.

Upvotes: 2

Related Questions