[
https://issues.apache.org/jira/browse/DIRAPI-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17325325#comment-17325325
]
Emmanuel Lécharny commented on DIRAPI-369:
------------------------------------------
No, there is a special attribute that is added when the value is base64 encoded:
{code:java}
if ( ParserUtils.needsBase64Encoding( value.getString() ) )
{
Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI );
Namespace xsiNamespace = new Namespace( "xsi",
ParserUtils.XML_SCHEMA_INSTANCE_URI );
attributeElement.getDocument().getRootElement().add( xsdNamespace );
attributeElement.getDocument().getRootElement().add( xsiNamespace );
Element valueElement = attributeElement.addElement( "value" ).addText(
ParserUtils.base64Encode( value.getString() ) );
valueElement
.addAttribute( new QName( "type", xsiNamespace ), "xsd:" +
ParserUtils.BASE64BINARY );
...
{code}
The last line add the {{xsd:base64Binary}} attribute for that purpose. There is
no possible confusion.
> DSML needsBase64Encoding
> ------------------------
>
> Key: DIRAPI-369
> URL: https://issues.apache.org/jira/browse/DIRAPI-369
> Project: Directory Client API
> Issue Type: Bug
> Reporter: Florian Kimmann
> Priority: Major
>
> Why does the method needsBase64Encoding in the dsml ParserUtils check for
> LDIF safety?
> DSML doesnt have to be LDIF safe? We get Base64 encoded strings in our
> application all the time, because of common german characters like äöüß etc.
> XML can handle those characters. Or am I overlooking something?
>
> [https://github.com/apache/directory-ldap-api/blob/275b9830b8b974dc19fb3b8d38c68061211fb5f7/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/ParserUtils.java#L167]
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]