0

I am designing an XML and wish to allow binary data to be encoded as either base16 or base64. The default will be base16.

For specifying base64, I wish to have an attribute. My two options are:

<foo encoding='base64'>TqpuiunH0mEWcSkYSINkTQffuny=</foo>

and:

<foo base='64'>TqpuiunH0mEWcSkYSINkTQffuny=</foo>

I think that the first is more descriptive but suspect that the second might be better. I'm looking for people's reactions.

Thanks.

2 Answers 2

6

Seeing as base64 is an encoding, the more semantic markup would be encoding="base64".

People seeing base may think about a decimal base or binary, for example, which I don't believe is what you would want a reader to think.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. That's my feeling as well.
1

Depends what the other options are. If the other options are base="2", base="10", or base="32" then I would use base="64". If the other options are encoding="hexBinary" and encoding="ebcdic" then I would use encoding="base64". I don't think you can decide the best representation for an attribute when you only know one of its possible values.

1 Comment

Thanks. I think that you've convinced me to go with encoding="base64"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.