xsl-list
[Top] [All Lists]

Re: [xsl] Dealing mixed content with invalid node-like text

2011-12-09 12:08:59
On Thu, Dec 8, 2011 at 4:16 PM, Karlmarx R <karlmarxr(_at_)yahoo(_dot_)com> 
wrote:
Brandon - Thanks for that <xsl:value-of select="replace($unparsed, 
'<(\S+\s+\.)>','<$1>')"/> suggestion. With a slight modification - removing 
\s, I can use this for my specific use (pls see next point). Btw, if a 
solution available to cover wider scope, I think that would be more 
beneficial.

I'm not sure why you need to remove the \s.  The '<(\S+\s+\.)>' regex
matches a less-than symbol, one or more non-whitespace (\S)
characters, one or more whitespace (\s) characters, a period (\.) and
then a greater-than symbol.  You didn't give a general pattern for the
non-XML sequences, so I had to guess based on the examples.

I'm not sure what you mean by "wider scope".  Would this be other
types of non-XML data in the source that needs to be encoded properly?
 Can you give some patterns that need to be recognized?

-Brandon :)

--~------------------------------------------------------------------
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>
--~--