 |
| 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
|
|
|
|

September 10th, 2007, 06:12 AM
|
|
Authorized User
|
|
Join Date: Jul 2007
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok, I got it that I am getting decimal 169 value for copyright symbol. But Is there a way to get back the hex A9 value.
May I need to change something in my encoding="" part etc.
Quite annoying, but seems to me that I will have to go with Perl.
Pankaj
|
|

September 10th, 2007, 06:22 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
I really fail to see why you are doing this. I've asked before, and you haven't given an explanation. In XML, xA9 and x169 are completely equivalent. If your recepient requires the XML to be in a particular form, then it's a badly broken design. Why are you using XML at all? Because you certainly aren't getting the benefits that come from using it properly.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

September 11th, 2007, 02:17 AM
|
|
Authorized User
|
|
Join Date: Jul 2007
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Michael,
I think I have tried to explain earlier why I need XSLT for this. I am working on Adobe Indesign for composition purposes, wherein my input is XML. This XML input has all the unicode entities defined in hex (e.g., ©) format.
I am using XSLT to add few attributes and elements before importing xml to pagination platform to get the speedy process at the composition stage. Later, once the composition is done, the xml gets exported from Adobe Ind itself as XML does not looses any structure except it contains the following:
1. The attributes and elements, which were added to it before importing.
2. All the unicode entities gets converted into their corresponding symbols.
The first point is not an issue and been taken care of with XSLT, but I was trying to handle the second point with XSLT itself (which is quite desirable), but seems to be tough for me.
I can fairly understand that &_#x000A9; and &_#169; are same for XSLT proc, but I need to get back the XML in the same format as it was before importing.
Using Perl gives me the desired output, but you are right, its quite dangerous to use Perl search and replace functionality, as it doesn't understand the XML structure and may lead to the errors. The biggest dilemma now is that I am running out of time and need to implement this workflow immediately, so I think I will take a chance using PERL as of now and will look into it later on.
By the way, I've read somewhere, there is a way of calling an External script from stylesheet using <xsl:script>. Can you please throw some light on it as I never tried this neither it was required earlier.
I am using XSLT version="1.0" on MAC, with a choices of using Sablotron or LibXSLT.
Thanks for your support.
Pankaj
|
|

September 11th, 2007, 02:39 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
>This XML input has all the unicode entities defined in hex (e.g., ©) format.
If the receiving process asks for XML, then it should accept any representation of these characters that is legal in XML. If it doesn't, then it's an appallingly badly designed piece of software and you should steer clear of it.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

September 11th, 2007, 03:35 AM
|
|
Authorized User
|
|
Join Date: Jul 2007
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yeah I understand. I should try convincing my recipient
By the way, I've read somewhere, there is a way of calling an External script from stylesheet using <xsl:script>. Can you please throw some light on it as I never tried this neither it was required earlier.
I am using XSLT version="1.0" on MAC, with a choices of using Sablotron or LibXSLT.
Thanks for your support.
Pankaj
|
|
 |