Displaying Base64Binary Problem
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 8
- Joined: Wed Nov 09, 2005 12:31 pm
Displaying Base64Binary Problem
Hi all, i encountered a problem on displaying node value which is in Base64Binary data type when send it to XSL page. The node value is showing belows:
The original value before convert to binary type is "Testing".
In XSL, when i select the node value:
the XSL returned the binary value, "VABlAHMAdABpAG4AZwA=" not "Testing".
Actually my expected output is "Testing".
Does anyone know how to convert the binary data to string in XSL, please help me to solve the problem.
Code: Select all
<MessageTest xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">VABlAHMAdABpAG4AZwA=</MessageTest>
In XSL, when i select the node value:
Code: Select all
<xsl:value-of select=".//MessageTest">
Actually my expected output is "Testing".
Does anyone know how to convert the binary data to string in XSL, please help me to solve the problem.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Ivan,
Note that base64 encoding encodes a binary value as text. So VABlAHMAdABpAG4AZwA= is not the binary value, is the text and the bytes representing Testing are forming the binary value. Now XSLT does not work at bytes level so you cannot output bytes from XSLT. The only way you can handle this from XSLT is to use some extension function that given a base64 encoded value will decode that to the encoded bytes and then will use the encoding you know was used to extract a text from those bytes and return that text.
Best Regards,
George
Note that base64 encoding encodes a binary value as text. So VABlAHMAdABpAG4AZwA= is not the binary value, is the text and the bytes representing Testing are forming the binary value. Now XSLT does not work at bytes level so you cannot output bytes from XSLT. The only way you can handle this from XSLT is to use some extension function that given a base64 encoded value will decode that to the encoded bytes and then will use the encoding you know was used to extract a text from those bytes and return that text.
Best Regards,
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service