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 November 11th, 2005, 03:18 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default Entities as String

How come this replies an error when process?
<xsl:variable name="entities" as="xs:string*" select="('&aeiubareiubar;','&aneiubareiubar;','&ar eiubareiubar;')"/>
As you can see, the variable is an array that needs to have values with entities but still the processor parse these strings and reply an error that it should be declared. Can I used these strings as plainly strings and not be interpreted by the processor as entities?
Thanks.

 
Old November 11th, 2005, 09:16 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

A stylesheet is an XML document and must be well-formed XML. That means that an ampersand must be part of a valid entity reference. If you want to use an ampersand in any other context, it must be written as &amp;

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 12th, 2005, 01:25 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I see... So the result of it would be &aeiubareiubar; for this example. But it does not. I used a character map for $amp;amp but still no luck. Thanks.

 
Old November 12th, 2005, 12:15 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

No, the only possible result for this example is an error,because the stylesheet is not well-formed XML.

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
Convert entities... carlosaml XSLT 12 October 17th, 2007 03:52 AM
referenced entities bcogney XML 7 April 21st, 2006 11:04 AM
referenced entities bcogney XSLT 0 April 20th, 2006 02:37 PM
Entities safin XSLT 1 November 7th, 2005 04:59 AM
Escaping Ampersand Entities android66 Visual Basic 2005 Basics 2 February 5th, 2005 04:46 AM





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