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 August 4th, 2010, 04:41 AM
Authorized User
 
Join Date: Jul 2010
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default using the & char in xml/xsl file

Hi,

my xml file has the example tag with

<tag>value&value</tag>

there is an error when start the xsl file...

I use also &amp and the header
<?xml version="1.0" encoding="iso-8859-1"?>

but not ok

Thanks!
 
Old August 4th, 2010, 04:53 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

More info needed. What exactly is the error message and can you show a small reproducible example so we can test ourselves?
__________________
Joe
http://joe.fawcett.name/
 
Old August 4th, 2010, 05:30 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

Change
Code:
<tag>value&value</tag> to <tag>value&amp;value</tag>
. If this is not what you need, please post the input xml and the xslt code you use.
__________________
Rummy
 
Old August 4th, 2010, 08:39 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If your file contains <tag>value&value</tag>, then it's not an XML file. In XML, ampersand is always escaped as & a m p ; (without the spaces). You need to correct the file, or the program that corrected the file, to make it well-formed XML before you can process it.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old August 4th, 2010, 10:58 AM
Authorized User
 
Join Date: Jul 2010
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks!!!

The solution is ";"

my code is <tag>value&ampvalue</tag>...

....correct your code: <tag>value&amp;value</tag>

Excuse...





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass the dynamic XML file name to XSL jle XSLT 3 March 13th, 2008 04:20 PM
insert in xsl template some xml file ratzko XSLT 2 January 16th, 2008 08:30 AM
XSL to replace text in XML file neetukk XSLT 1 November 29th, 2006 05:20 AM
XML To XML, using XSL & XSD supercop75 XSLT 1 April 8th, 2006 02:48 AM
XSLT transformation from XML buffer and XSL file sundaramkumar Javascript 1 September 5th, 2005 02:11 AM





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