[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

HTML within an element

Subject: HTML within an element
From: Nathan Shaw <n8_shaw@xxxxxxxxx>
Date: Mon, 23 Jul 2001 09:32:50 -0700 (PDT)
grabbing html elements
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.