I have a lot of xmls with pdf data that is them and encoded with B64 encoding.
<Document>
<component>
<nonXMLBody>
<text mediaType="application/pdf" representation="B64">JVBERi0xLjMNJf////
</text>
</nonXMLBody>
</component>
</Document>
I have two problems: 1) figuring out the right syntax to get all of the data out. I keep getting truncated versions. I've tried varchar(max) and varbinary.
SELECT x.value('(component/nonXMLBody/text/text())[1]','varchar(max)') as
FROM @XML.nodes('/Document') as Addr (x))
2) How to decode the B64 data.
I found a post that seems like it is close to what I need but I'm still stuck. Base64 encoding in SQL Server 2005 T-SQL
Thanks in advance for any help