BAD MSG: passed. If you want to include all of the markup, you'll need to hunt round for a serializer that will take in a NodeIterator and produce a string. I think there may be one in XalanJ or XercesJ but I haven't delved into that. If you get stuck, please let us know and we'll look around.
HTH, Gary > -----Original Message----- > From: Brad Cox [mailto:[EMAIL PROTECTED] > Sent: Sunday, February 03, 2002 11:06 AM > To: Gary L Peskin > Cc: Brad Cox; [EMAIL PROTECTED]; 'Frank E. Weiss' > Subject: Re: xalan extensions, cont'd. > > > > On Sunday, February 3, 2002, at 01:51 PM, Gary L Peskin wrote: > > I'm afraid that I'm at a loss understanding exactly what > the problem > > is from your description. What leads you to believe that > "markup is > > deleted when the results are saved in a variable"? What does your > > addPage method look like now with this third argument? > > Sorry I wasn't clear. Here's the addPage method: > > public void addPage( String ident, String body) > { > System.err.println("addPage:"+body); > pages.add(new Page(this, ident, body, new > IntegerField(pages.size()))); > } > > With this xml input file: > > <task ident="Lorem Ipsem"> > <page ident="Intro"> > <h2>Lorem Ipsem</h2> > <p>Lorem ipsum dolor sit amet</p> > </page> > </task> > > The println statement should print > > addPage:<h2>Lorem Ipsem</h2> > <p>Lorem ipsum dolor sit amet</p> > > What I'm getting is: > > addPage:Lorem Ipsem > Lorem ipsum dolor sit amet > > If I add an apply-tempaltes outside the variable assignment, I > see the correct output, e.g. with markup. > > These omit the CopyOf{...} stuff (see below) which I added to > help diagnose the problem. > > > > >> -----Original Message----- > >> From: Brad Cox [mailto:[EMAIL PROTECTED] > >> Sent: Sunday, February 03, 2002 10:30 AM > >> To: Brad Cox > >> Cc: Gary L Peskin; [EMAIL PROTECTED]; 'Frank E. Weiss' > >> Subject: Re: xalan extensions, cont'd. > >> > >> > >> On Sunday, February 3, 2002, at 09:45 AM, Brad Cox wrote: > >> > >>> One last glitch and I"m there. All xhtml markup is being stripped > >>> from $pageText. > >> > >> This is driving me crazy. I'm still hung on the same problem. Can > >> someone please help? Here's the nub of it: > >> > >> <xsl:template match="page"> > >> <xsl:variable name="body"> > >> #parse("vel/macros.vel") > >> #taskOpening("@ident") > >> <xsl:apply-templates select="*"/> > >> #taskClosing("@ident") > >> </xsl:variable> > >> PageText{<xsl:value-of select="$body"/>} > >> <xsl:value-of select="task:addPage($task, @ident, $body)" /> > >> </xsl:template> > >> > >> I've confirmed that the $body variable within the addPage routine > >> contains only text minus markup. In particular, for > >> > >> <task ident="HelloWorld"> > >> <page ident="LoremIpsem"> > >> <p>Foo</p> > >> </page> > >> </task> > >> > >> I'm seeing CopyOf{Foo} in the output when I should be seeing > >> <p>CopyOf(<p>Foo</p>)</p>. It appears that markup is > deleted when the > >> results are saved in a variable. If I add a <xsl:apply-templates > >> select="*"/> outside of the variable assignment in the above, the > >> output contains markup as expected. > >> > >> Here is the whole stylesheet. > >> > >> <?xml version="1.0"?> > >> <xsl:stylesheet version="1.0" > >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > >> xmlns:task="edu.virtualschool.model.Task" > >> extension-element-prefixes="task" > >> exclude-result-prefixes="java" > >>> > >> <xsl:output method="html"/> > >> <xsl:param name="task">null</xsl:param> > >> > >> <xsl:template match="/task"> > >> #set($totalPages = <xsl:value-of select="count(page)"/>) > >> #set($pageTitles = [<xsl:for-each select="page">"<xsl:value-of > >> select="@ident"/>",</xsl:for-each>"Submit page"]) > >> <xsl:apply-templates select="page"/> </xsl:template> > >> > >> <xsl:template match="page"> > >> <xsl:variable name="body"> > >> #parse("vel/macros.vel") > >> #taskOpening("@ident") > >> <xsl:apply-templates select="*"/> > >> #taskClosing("@ident") > >> </xsl:variable> > >> PageText{<xsl:value-of select="$body"/>} > >> <xsl:value-of select="task:addPage($task, @ident, $body)" /> > >> </xsl:template> > >> > >> <xsl:template > >> match="EmailQuestion|EssayQuestion|NameQuestion|UrlQuestion|Ph > >> oneQuestion" > >>> > >> #<xsl:value-of select="name()"/>("<xsl:value-of select="@ident"/>" > >> "<xsl:value-of select="normalize- > >> space(text())"/>") > >> </xsl:template> > >> > >> <xsl:template match="MenuQuestion|RadioQuestion|CheckboxQuestion"> > >> #<xsl:value-of select="name()"/>("<xsl:value-of select="@ident"/>" > >> "<xsl:value-of select="normalize- space(text())"/>" [<xsl:for-each > >> select="option">"<xsl:value-of select="."/>"<xsl:if > >> test="not(position() = > >> last())">,</xsl:if></xsl:for-each>]) > >> </xsl:template> > >> > >> <xsl:template match="*"> > >> <p>CopyOf{<xsl:copy-of select="."/>}</p> > >> </xsl:template> > >> > >> </xsl:stylesheet> > >> > > > > > > > Brad Cox, Ph.D.; [EMAIL PROTECTED] 703 361 4751 > For industrial age goods there were checks and credit cards. > For everything else there is http://virtualschool.edu/mybank > Java Web Application Architecture: http://virtualschool.edu/jwaa >
