This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Implementing " and ' in literals



> In XML::XPath (perl's XPath processing module) I implemented translation
> of " and ' in literals to " and ' respectively.
> So what do people think of this?

I think it's completely broken!

The behaviour of the entities is completely determined by the XML
specification, so if you deviate from that there will be no way of
sharing stylesheets between XML::XPath and a conforming XSL system.

So it adds no new functionality and breaks interoperability.


> <xsl:value-of select="&quot;I'm feeling &amp;quot;sad&amp;quot;&quot;"/>
> 
> Which gives you a literal of:

> I'm feeling "sad"

The value of the above is the value of the xpath expression
 "I'm feeling &quot;sad&;quot;"

which is the string, when written out in XML syntax looks like

I'm feeling &amp;quot;sad&amp;quot;

If you want to produce the string I'm feeling "sad" then just use
 
<xsl:value-of select="translate('IXm feeling &quot;sad&quot;','X', &quot;'&quot;)"/>

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]