Again... What do I do if I want to have the ' ' in my .xsl file? When I run the SimpleTransform example and have the " " in my .xsl file I get an error: javax.xml.transform.TransformerConfigurationException: The entity 'nbsp' was referenced, but not declared. How do I write so it doesn't think it's an entity? Problem 2: I want to have the 'nowrap' in my HTML tag <td> but the transformer can't handle it. /Nils
As for the nowrap attribute, there should be no problem with generating it. Can you give a little more information about what you are trying, and what actually happens?
Joined: May 25, 2001
When I put the nowrap in I get this error: Attribute name "td" must be followed by the '=' character The code: <td class="txt" valign="top" align="right" NOWRAP> When I take the nowrap away it works fine. If I change the & nbsp to & amp;nbsp; it just writes it to the screen. /Nils
Joined: Jan 07, 1999
Ah, I see the problem with the nowrap. It's not valid XML. Have you tried adding a dummy value for the nowrap attribute: nowrap='' ? As for the nbsp, what are you using to process your XSL, and how are you sending the result to the browser? I've generated entity sequences like this before with no trouble, so I guess you are doing something a bit different from my experience.
Joined: May 25, 2001
Thanks. Ok, I try nowrap= thing... I use the SimpleTransform example from IBM LotusXSL. That takes two files .xsl and .xml and a third output file .html. From my site I just include the .html file. Do I have to have a .dtd file to declare the nbsp? /Nils
XSL stylesheet is an XML document itself, so it is perfectly possible to have DTD in it: <?xml version='1.0'?> <!DOCTYPE stylesheet [ <!ENTITY nbsp "�" > ]> <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> ...
Then you can simply type in your XSLT. I used the construction above and it works fine [This message has been edited by Mapraputa Is (edited June 08, 2001).]
Interesting. NOWRAP thing is rather mysterious. Seems to be the only HTML attribute breaking well-formedness. But it is how TD tag is defined: <TD LANG="..." DIR=ltr|rtl ID="..." CLASS="..." AXIS="..." AXES="..." NOWRAP ROWSPAN=value COLSPAN=value ALIGN=left|right|center|justify|char|decimal CHAR="..." CHAROFF="..." DP="..." VALIGN=top|middle|bottom|baseline WIDTH=value BGCOLOR="...">characters...</TD> I wonder what was the reason to make NOWRAP a syntactic exception? Also <P> tag is defined as <P ... WRAP=on|off NOWRAP ...>
I hope Frank�s variant will work. If not, you will need to bury yourself into <xsl:text> mess If you need simply output TD tag with NOWRAP word, regardless of XML data, you can go like this: <xsl:text disable-output-escaping="yes"> <td class="txt" valign="top" align="right" NOWRAP> </xsl:text>
If you need to output some part of the TD tag based on XML data, say, you need to read the value for your class attribute, then it is a bit more complicated. Assuming the value is in <properElement properAttribute=�...�>, we break the target expression into three parts: 1. <xsl:text disable-output-escaping="yes"> <td class="</xsl:text> 2. <xsl:value-of select="properElement/@properAttribute"/> 3. <xsl:text disable-output-escaping="yes">" valign="top" align="right" NOWRAP> </xsl:text>
[This message has been edited by Mapraputa Is (edited June 08, 2001).]
Dear..., I don't know whether u still have the problem with the space. Still I have something that works.( I have seen it work. ) <xsl:text disable-output-escaping="yes">& amp;nbsp;</xsl:text> whereever you wish to use �. Using an entity that puts in ' ' in a document is as good as putting a space. I guess so! please correct me if I am wrong. AJD. ------------------ -AJD. [This message has been edited by Aldrin Dsouza (edited July 09, 2001).] [This message has been edited by Aldrin Dsouza (edited July 09, 2001).]