[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: first question to the list: contains
Subject: Re: first question to the list: contains
From: "B. Kamer" <post@xxxxxxxxxxx>
Date: Fri, 2 Nov 2007 23:29:52 +0100
|
Jared,
xml can't contain & witout cdata?
<xsl:variable name="jpstr">
<xsl:text><![CDATA[&#]]></xsl:text>
</xsl:variable>
On 2 nov 2007, at 23:22, Jared Stein wrote:
Hi folks, I'm pretty new to XSL, at least to using it seriously for
projects, and I've hit a snag that I can't seem to figure out. It's
probably pretty simple, but I'm not 100% clear on how escaping works
in
XSL.
Basically we've got some decimal unicode Japanese characters in our
XML
file, e.g. え. I need to test for these inside of an element
so I
can add a CLASS attribute to the DIV that will contain them. I'm
confident there are no other unicode elements in the document, and
so I
tried to do something as simple as this:
<xsl:variable name="jpstr">
<xsl:text>&#</xsl:text>
</xsl:variable>
<div>
<xsl:if test="contains(wording,$jpstr)">
<xsl:attribute name="class">
<xsl:text>fs front jpns</xsl:text>
</xsl:attribute>
</xsl:if>
...etc
If I change $jpstr's value to normal letters it works just fine, but
for some reason I can't get it to detect either &# or &#.
Any
help is greatly appreciated.
Jared Stein
Director of Instructional Design Services
Utah Valley State College, MS 149
Teaching w/ Technology Idea Exchange 2008: The Open Conference
Submit your presentation proposal now! http://www.ttix.org
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|