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 March 1st, 2007, 05:32 PM
Authorized User
 
Join Date: Feb 2007
Posts: 51
Thanks: 3
Thanked 0 Times in 0 Posts
Default Codepage 1252 (Western) Issue?

Hello,
I am getting a transformation error stating that my file "contains 4 characters that should not be present in a file using the Codepage 1252 (Western) encoding". It claims the offending characters are "0x9D", but I am dubious of this character information as I do not find that string in the xml file.

In any case, it allows me to continue the translation, but it (XMLSpy ver 5 rel 2) insists on applying "substitution characters" where ever it finds the so called dis-allowed characters.

When it generates the output with the substituted characters, it clearly was hiccup-ing anywhere there was a "<" as the start of the html tag. I can tell this is the case because I am seeing the tail-end of every corresponding html tag (output as plain text since the browser never finds the "<" tag. As an example, I see td>, /td>, etc. all over the place.

Incidently, I am puzzled that when I perform the exact same transformation against the exact same XML/XSL files using a newer version of XMLSpy (2007 SP2), I never had this problem. If you are wondering why I don't simply stay with the newer version, its because I have the older version imposed upon me by the customer.

As a little bit of extra information, the input XML file presents "<" as "&lt;". For this reason, I had always been using d-o-e when outputting text. Again, always worked fine with XMLSpy 2007. Any help is greatly appreciated. Thanks

 
Old March 1st, 2007, 07:29 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Can't help you at all from the information given. If it works with a newer release of Altova then it sounds as if it's a bug in the older release.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old March 2nd, 2007, 12:20 PM
Authorized User
 
Join Date: Feb 2007
Posts: 51
Thanks: 3
Thanked 0 Times in 0 Posts
Default

The offending sequence of characters that resulted in the character replacement was several places where double-quotes were nested within other double quotes. For instance, while performing transformation against input XML file that had:

<publish:property name="Body" publish:category="UML" publish:description="The Body of the Comment" publish:value=" user that, pursuant to 19, “is one who undertakes to eat fish[across the park].” Each use is assigned a code."/>

The xsl code where the replacement was forced to take place by XMLSpy (ver 5 rel 2) was:
[list]
                        <li>
                            <xsl:value-of select="ownedComment/@body" disable-output-escaping="yes"/>
                        </li>
                    </ul>

Again, I did not have similar issues with XMLSpy 2007 SP2. I sure wish I knew what to do here, short of stripping all input files of nested quotes...

 
Old March 2nd, 2007, 12:48 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>while performing transformation against input XML file that had:

<publish:property name="Body" publish:category="UML" publish:description="The Body of the Comment" publish:value=" user that, pursuant to 19, "is one who undertakes to eat fish[across the park]." Each use is assigned a code."/>

That's not well-formed XML, so no XSLT processor should ever accept it. You need to fix the process that's generating the data incorrectly.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old March 2nd, 2007, 01:26 PM
Authorized User
 
Join Date: Feb 2007
Posts: 51
Thanks: 3
Thanked 0 Times in 0 Posts
Default

My editor (XMLSpy) is telling me that the xml file is well-formed. Which part of the content is wrong exactly?

 
Old March 2nd, 2007, 01:43 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If an attribute is delimited by double quotes then it can't contain double-quotes, they should be escaped as &_quot; (ignore the underscore)

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Codepage minhtri Classic ASP Professional 1 April 20th, 2005 04:16 AM
CODEPAGE="1252" crmpicco Javascript 2 January 27th, 2005 10:22 AM
Edit with word. Codepage/encoding problem?? pskofod ASP.NET 1.0 and 1.1 Basics 1 April 29th, 2004 02:57 AM
Codepage kochoo Classic ASP Basics 1 April 24th, 2004 01:28 AM
Codepage Problem? birdcage Classic ASP XML 2 October 21st, 2003 06:10 AM





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