[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Question About Translate Function

Subject: RE: Question About Translate Function
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 26 Nov 2005 08:27:53 -0000
xslt translate function
To write the < and > characters in an XML document (such as an XSLT
stylesheet), use &lt; and &gt; 

I haven't even tried to understand why you want to change > into >, however.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: floatingisland@xxxxxxx [mailto:floatingisland@xxxxxxx] 
> Sent: 26 November 2005 05:58
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Question About Translate Function
> 
> Hi,
> 
> Using the XSLT translate function, is there a way to change
> < to > and > to >. I have an XML document, saved out
> of Microsoft InfoPath, which changes the XML tags pasted into
> a text box into a text string of (for example) 
> <myXmlElementName>myXmlElementText</myXmlElementName>
> instead of <myXmlElementName>myXmlElementText</myXmlElementName>
> 
> I'm using Apache Cocoon Version 2.0.3.
> This is the translate function that I'm using:
> <xsl:value-of select="translate(//myXmlElementName, '<', '<')" />
> <xsl:value-of select="translate(//myXmlElementName, '>', '>')" />
> 
> This is part of the error message that Cocoon generates:
> 
> The value of attribute "select" must not contain the '<' character.
> org.apache.cocoon.ProcessingException: Exception in creating 
> Transform 
> Handler:
> org.xml.sax.: SAXParseException: The value of attribute "select" must 
> no conatin
> 
> 
> the "<" character.
> 
> Any ideas?
> 
> Thanks,
> 
> Greg

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.