[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Processing Entity ' question
Are you using XSLT2/Xpath2? > In each case it acts like there are missing end parenthesis, no doubt > because the odd number of single quotes act like one quote. No (unless you are using Xpath2, which I suspect isn't the case) All three of the things you tried are equivalent to ''' (enity and character references are expanded before Xpath is parsed) so are an empty string followed by a trailing ' which is a ayntax error. The FAQ has entries on this but basically, start from the Xpath you need and worry about xml quoting later. You want the string literal "'" (you have to use " to delimit a string literal involving a ' in Xpath 1) so you want the XPath string-length(string-before($myValue,"'"))>0 (or equivalently starts-with($myValue,"'") ) As far as XML is concerned, the above may as well be jhgkjg"nbfjh' just some random string involving " and ' to get that into an attribute you always have two choices delimit with " and quote any " or delimit with ' and quote any ' so test="string-length(substring-before($myValue,"'"))>0" or test='string-length(substring-before($myValue,"'"))>0' If you are using Xpath2 then a doubleed ' (or ") counts as a single ' in a string literal so you could then do test='string-length(substring-before($myValue,''''))>0' which avoids using xml quotes at all, although I'm not sure it's any more readable. Incidentally In the file is it properly represented with an internal entity. The XML looks like <LogicalFieldName>Broker's ZIP</LogicalFieldName> You could of course use ' rather than '; in the source although that wouldn't change the XSLT required. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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
|