[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Dealing mixed content with invalid node-like text
Thankyou very much for further recommendations, very useful. 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. David - On your /htmlparse.xsl + <xsl:sequence select="d:htmlparse($in,'',false())"/> suggestion, Yes I want something like that. Your solution almost worked, except for a glitch (minor or major?). Of the example text, <xsl:variable name="in"><![CDATA[Line one text <b>within valid node</b> and like <II .> Title etc Line two with <1a .> Title etc, <i>within</i> <b>something</b> etc another line can be just normal text]]></xsl:variable> the <II .> and <2 .> have "space" between the dot and previous letters. If I had texts WITHOUT SPACE, like <II.> or <3.>, then it fails. I have not fully gone through your htmlparse.xsl whether any tweaks can be made so that this can be covered. But if it can be achieved, then that would be the ideal solution. For example, I think such fix will also cover a scenario (hypothetical) like, <xsl:variable name="in"><![CDATA[Line one text with <bbbb> like invalid node item and like <5.> Chapter V with valid <b>bold title</b> etc]]></xsl:variable>, to give an output like <output>Line one text with <bbbb> like invalid node item and like <5.> Chapter V with valid <b>something</b> etc</output> Is this possible to achieve tweaking your code? Thanks, karl
|
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
|