XLS problem? JBoss terribly slow

Discussion in 'XML' started by Angus Parvis, Aug 31, 2004.

  1. Angus Parvis

    Angus Parvis Guest

    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
    Angus Parvis, Aug 31, 2004
    #1
    1. Advertising

  2. 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
    David Carlisle, Aug 31, 2004
    #2
    1. Advertising

  3. Angus Parvis

    Angus Parvis Guest

    David Carlisle wrote:

    > 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
    Angus Parvis, Aug 31, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JDS
    Replies:
    2
    Views:
    426
  2. han
    Replies:
    0
    Views:
    471
  3. Jubz
    Replies:
    0
    Views:
    2,223
  4. Replies:
    8
    Views:
    774
    Juan T. Llibre
    May 13, 2008
  5. Ryan Mulligan

    Is CGI::Cookie::parse terribly broken?

    Ryan Mulligan, Jul 23, 2008, in forum: Ruby
    Replies:
    0
    Views:
    236
    Ryan Mulligan
    Jul 23, 2008
Loading...

Share This Page