// EncodeDocument encodes the given document using the given media type and returns
// a string with the encoded data.
EncodeDocument encodes the given document using the given media type and returns
a string with the encoded data.
// EncodeDocument encodes the given document using the given media type and returns // a string with the encoded data .
func EncodeDocument(doc Document, mediaType MediaType) (string, error) {
	docBytes, err := canonicalizer.MarshalCanonical(doc)
	if err != nil {
		return "", fmt.Errorf("marshal canonical: %w", err)
	}
	return Encode(docBytes, mediaType)
}
func EncodeDocument ( doc Document , mediaType MediaType ) ( string , error ) { docBytes , err := canonicalizer . MarshalCanonical ( doc ) if err != nil { return " " , fmt . Errorf ( " " , err ) } return Encode ( docBytes , mediaType ) }
EncodeDocument encodes the given document using the given media type and returns
a string with the encoded data.
EncodeDocument encodes the given document using the given media type and returns a string with the encoded data .