xsl-list
[Top] [All Lists]

Processing Entity ' question

2005-02-05 15:58:16
I have been pulling what is left of my hair out this morning.  I hate to
bother this group with such a simple question.  I have looked in books and
at FAQ

Problem:  An XML element content has a single quote in it, as in "Broker's
ZIP".  In the file is it properly represented with  an internal entity.  The
XML looks like <LogicalFieldName>Broker&apos;s ZIP</LogicalFieldName>

The <xsl:output> is set to text.  I am writing SQL statements from the XML.
In Oracle to represent the single quote as content you use three single
quotes. For example

WHERE FLDNAME=' Broker'''s ZIP'.

I can not find the construction that will let me detect the existence of the
single quite.

Assume
<xsl:varable name=myValue select="Broker&apos;s ZIP"/>

The value is really pulled from the source document.  Showing the variable
content in StylusStudio debug shows the single quote is there. 

This construction works to find the 'r'
<xsl:if test="string-length(string-before($myValue,'r'))>0">

I have tried
<xsl:if test="string-length(string-before($myValue,'''))>0">   --- quoted
quote
and
<xsl:if test="string-length(string-before($myValue,'&apos;'))>0">  quoted
entity
and
<xsl:if test="string-length(string-before($myValue,'&#39;'))>0"> quoted
character encode

In each case it acts like there are missing end parenthesis, no doubt
because the odd number of single quotes act like one quote.  

Any ideas?

Greg





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>