[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] HTML within an element
I am still having problems grabbing the text of an element if it contains HTML. i.e. External DTD declaration: <!ELEMENT SubSectionText (#PCDATA)> XML: <Section Title="Mission" URL="StrategicVision.htm#mission"> <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> </Section> XSL: <xsl:template match="SectionText"> <xsl:if test="string-length(text()) > 0"><p><xsl:copy-of select="text()" /></p></xsl:if> </xsl:template> When I try to pull out the text of the SectionText element, I get an error "Element invalid according to DTD. Expecting #PCDATA." I have also tried changing the XSL to use: <xsl:template match="SectionText"> <xsl:if test="string-length(text()) > 0"><p><xsl:copy-of select="." /></p></xsl:if> </xsl:template> But, I get the same error. Do I have to define a template for every single possible HTML element that could be used within the SectionText element (B, STRONG, I, EM, A, etc...)???? Nate ===== ---------------------------- Nathan Shaw Web Applications Developer iaffect http://www.iaffectonline.com http://www.iaffectTV.com ---------------------------- __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ 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
|