|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: HTML within an element
This isn't an XSL question External DTD declaration: <!ELEMENT SubSectionText (#PCDATA)> so SubSectionText can only have text (not elements) which means that your input <SectionText>Conduct basic and applied research to support human exploration of <em>space</em> is not valid. However XSL does not require valid input, mearly well formed, so you are OK so long as you use a non-validating parser. <xsl:template match="SectionText"> <xsl:if test="string-length(text()) > 0"><p><xsl:copy-of select="text()" /></p></xsl:if> </xsl:template> That is legal but not what you want to do, it just selects the text nodes which are children of SectionText <SectionText>Conduct basic and applied research to support human exploration of <em>space</em> and to take advantage of the <strong>space environment</strong> as a laboratory for <a href="test.htm">scientific</a>, technological, and commercial research.</SectionText> there are five text node children of SectionText so the p you generate is the concatenation of those, namely: Conduct basic and applied research to support human exploration of and to take advantage of the <strong>space environment as a laboratory for , technological, and commercial research. Probably you want <xsl:template match="SectionText"> <xsl:if test="string(.)"> <p><xsl:copy-of select="."/></p> </xsl:if> </xsl:template> David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








