I have a method that has a TextReader as input. Now I need to populate a TElXMLDOMDocument from this input (for the purposes of signing it). But all I can find is LoadFromStream and LoadFromFile. Is there any way to get it to read from the System.IO.TextReader?

But if the Stream is not in UTF-8 format I need to specify the encoding. And our application will provide me with a System.Text.Encoding object representing the encoding used, and it appears to me that the names returned from SBChSConv.Unit.EnumCharsets (as used in the SimpleSigner sample) seems to correspond to the "BodyName" property of the .NET Encoding object, and I just wanted to verify that this is indeed the case.

But if the Stream is not in UTF-8 format I need to specify the encoding.

Usually, xml documents have an xml header declaration like "<?xml version=“1.0” encoding=“UTF-8”?>". In case if encoding value doesn't match the loaded encoding, the component will reload a document with correct encoding. "DefaultEncoding" parameter used only if an xml document doesn't have encoding in the header.

Yes, I am aware of the XML declaration, and that the encoding may be specified there. But in the absence of such a declaration, I still need to specify an encoding. And I still want to know how correctly get from a .NET System.Text.Encoding instance to the string to pass into the SBB method(s).

But in the absence of such a declaration, I still need to specify an encoding. And I still want to know how correctly get from a .NET System.Text.Encoding instance to the string to pass into the SBB method(s).

I would say that WebName property better suits here.

By the way, there is a method SBXMLUtils.Unit.ParseElementFromXMLString that allows to parse xml element (for example: document element without an xml header) from a string.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.