xalan xslt transform

G

gaiduri

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>

once again, it breaks after the semicolon.

my question is, why?
 
J

Joe Kesselman

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.
 
G

gaiduri

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.

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.
 
J

Joe Kesselman

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.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top