XLS problem? JBoss terribly slow

A

Angus Parvis

Hi,

in order to use HTML entities in a XSL Stylesheet i defined them at the
top of the document as I've been told in this group. My code look like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY amp "&">

[..]
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

But when i run my application on JBoss, i get hundreds of errors, but
all of the same kind:

[Error] :16:80: Element type "xsl:stylesheet" must be declared.
[Error] :17:51: Element type "xsl:eek:utput" must be declared.
[Error] :22:91: Element type "xsl:variable" must be declared.
[..]
[Error] :66:25: Element type "xsl:template" must be declared.
[Error] :68:7: Element type "html" must be declared.
[Error] :69:7: Element type "head" must be declared.
[Error] :71:8: Element type "title" must be declared.
[Error] :72:47: Element type "link" must be declared.
[Error] :75:72: Element type "body" must be declared.
[..]

It seems like I get an error for every single tag used in the XSL - no
matter if it's XML/XSL or HTML.

Here's a part of the XSL Stylsheet to show the way I code:

<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="202">
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<xsl:choose>
<xsl:when test="$language = 'de'">
<tr>
<td class="v0"><xsl:text>deutsch </xsl:text><a
href="{$currentURL}?language=en">english</a></td>
</tr>
</xsl:when>
<xsl:eek:therwise>
<tr>
<td class="v0"><a
href="{$currentURL}?language=de">deutsch</a><xsl:text>
english</xsl:text></td>
</tr>
</xsl:eek:therwise>
</xsl:choose>
<xsl:choose>
[..]

By the way: The application works, but it's slow as a snail. So how can
i fix this problem?

I appreciate any help, thx for it in advance,

Angus
 
D

David Carlisle

your xml parser is defaulting to being a validating parser if it sees a
DOCTYPE, this is never what you want to do for xsl: your declared dtd
defines no elements so every element will generate an error.

The parser probably has a customisation switch somewhere to force it to
be a non-validating parser, however why use entities at all, they are
just creating more work for you and the system.


To use "& n b s p ;" in the body of the stylesheet you have to add all the
DOCTYPE and entity declaration at the top of the file which is a pain
even if it doesn't force the parser into validating mode.

You could just use "& # 1 6 0 ;" which is no harder to type and doesn't
require any declarations.

It makes no difference to XSLT which form you use (in particular it won't
affect whether or not entities are used on output) as the entities and
character references are resolved by the parser before XSLT starts, it
has no record of which form was used in the input.

David
 
A

Angus Parvis

David said:
You could just use "& # 1 6 0 ;" which is no harder to type and doesn't
require any declarations.

That's new to me (since i'm quite new to XML/XSL ..). Thank you very
much for you help. I've done it like you suggested and it works just as
I want ;)

Angus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top