Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 2nd, 2008, 06:40 AM
Registered User
 
Join Date: Sep 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default string to binary conversion in XSLT

hello everyone.
i m using XSLT version 1.0
i m picking data of table in XML which contains a column of image data type.
when i converted this XML document to other using XSLT binary data is written like string and when i tried to store this data into table it returns error cannot convert string to binary???

can we convert string to binary in XSLT

Regards
navi

 
Old September 2nd, 2008, 07:03 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XML only handles character data. Perhaps you need to convert the character data to binary as a postprocessing phase after the XSLT transformation.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old September 2nd, 2008, 07:04 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

XML as it stands cannot store binary data, so that binary data must be being converted into a string to be stored in your XML.

You will therefore have to convert it back to binary format when you are trying to insert it into the database.

As XSLT cannot by itself insert things into databases you must be using some other technology, which will probably be the part that does that conversion.

/- Sam Judson : Wrox Technical Editor -/
 
Old September 3rd, 2008, 01:31 AM
Registered User
 
Join Date: Sep 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually i have written XML file for table which contains binary data.
when it is converted into xml a string of binary data written.

Is there any way to convert this string data back into binary while converting into another XML through XSLT.



 
Old September 3rd, 2008, 01:42 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

We've already said, XML cannot hold binary data - therefore the answer is no.



/- Sam Judson : Wrox Technical Editor -/
 
Old September 3rd, 2008, 03:14 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If you want help, you are going to have to give a much more detailed explanation of what you are doing.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
2's Complement binary to decimal conversion gbilios C++ Programming 7 February 25th, 2013 09:46 AM
VB 2005 question, binary to text file conversion pitcher General .NET 0 September 24th, 2007 07:45 PM
PROGRAM FOR DECIMAL TO BINARY CONVERSION bharathidhas C# 1 December 13th, 2006 02:53 AM
hex conversion to binary files chrispbrown2255 C++ Programming 1 March 15th, 2006 06:06 PM
String to Binary, Binary to String matt.fields VB.NET 2002/2003 Basics 3 November 5th, 2003 05:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.