xalan xslt transform

Discussion in 'XML' started by gaiduri@gmail.com, Aug 9, 2007.

  1. Guest

    i have a question. the only thing i have not until this point done is
    trace this in the source. here is what i would like to do; i wish to
    perform a transform, however the following snippet is not properly
    transformed:

    <xsl:template match="/">
    <script language="JavaScript" type="text/javascript">
    <xsl:text>
    <![CDATA[
    function reset(elem1, elem2) {
    elem1.value = "";
    elem2.value = "";
    }

    the output of this stops after 'elem1.value=""', which is to say the
    semicolon breaks the transform

    the XML file includes the following:

    <form ... onsubmit="return validateForm(event, this);">

    i am processing this as;

    <xsl:attribute name="onsubmit"><xsl:value-of select="/form/@onsubmit"/
    ></xsl:attribute>


    once again, it breaks after the semicolon.

    my question is, why?
    , Aug 9, 2007
    #1
    1. Advertising

  2. wrote:
    > the output of this stops after 'elem1.value=""', which is to say the
    > semicolon breaks the transform


    Extremely unlikely; semicolon has no special meaning in XML. This sounds
    more like a SAX processing problem, frankly; there's a classic
    programming error wherein folks forget that SAX may break up text across
    multiple calls to characters().

    The fragment you gave us is obviously incomplete (it doesn't even close
    the CDATA section, never mind the elements), and you didn't show us the
    stylesheet, which makes diagnosis next to impossible. If you want
    assistance, post a more complete example -- preferably one which other
    folks can run to reproduce the problem.

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Aug 9, 2007
    #2
    1. Advertising

  3. Guest

    On Aug 8, 11:59 pm, Joe Kesselman <> wrote:
    > wrote:
    > > the output of this stops after 'elem1.value=""', which is to say the
    > > semicolon breaks the transform

    >
    > Extremely unlikely; semicolon has no special meaning in XML. This sounds
    > more like a SAX processing problem, frankly; there's a classic
    > programming error wherein folks forget that SAX may break up text across
    > multiple calls to characters().
    >
    > The fragment you gave us is obviously incomplete (it doesn't even close
    > the CDATA section, never mind the elements), and you didn't show us the
    > stylesheet, which makes diagnosis next to impossible. If you want
    > assistance, post a more complete example -- preferably one which other
    > folks can run to reproduce the problem.
    >
    > --
    > () ASCII Ribbon Campaign | Joe Kesselman
    > /\ Stamp out HTML e-mail! | System architexture and kinetic poetry


    thanks for your reply. i did what i should have done earlier and wrote
    a test harness for this and determined the problem is elsewhere; when
    the xsl and xml files are processed through my test harness the output
    is what i expect.
    , Aug 11, 2007
    #3
  4. wrote:
    > a test harness for this and determined the problem is elsewhere


    That's a large part of why I keep asking for complete (reduced)
    testcases that demonstrate a problem -- often the process of trimming
    the problem down is enough to expose the point of confusion.


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Aug 11, 2007
    #4
    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. Christopher Blunck

    Re: XSLT Performance with Xalan

    Christopher Blunck, Jul 29, 2003, in forum: Java
    Replies:
    1
    Views:
    390
    Bradley E. Rintoul
    Jul 29, 2003
  2. Brian Dobby
    Replies:
    0
    Views:
    402
    Brian Dobby
    Nov 28, 2003
  3. cvissy
    Replies:
    0
    Views:
    601
    cvissy
    Nov 16, 2004
  4. Rene van Hoek

    Xalan transform output to string

    Rene van Hoek, Nov 22, 2004, in forum: XML
    Replies:
    1
    Views:
    820
    Rene van Hoek
    Nov 23, 2004
  5. Replies:
    0
    Views:
    238
Loading...

Share This Page