Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   xalan xslt transform (http://www.velocityreviews.com/forums/t527926-xalan-xslt-transform.html)

gaiduri@gmail.com 08-09-2007 03:43 AM

xalan xslt transform
 
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?


Joe Kesselman 08-09-2007 03:59 AM

Re: xalan xslt transform
 
gaiduri@gmail.com 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

gaiduri@gmail.com 08-11-2007 01:43 AM

Re: xalan xslt transform
 
On Aug 8, 11:59 pm, Joe Kesselman <keshlam-nos...@comcast.net> wrote:
> gaid...@gmail.com 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.


Joe Kesselman 08-11-2007 03:43 AM

Re: xalan xslt transform
 
gaiduri@gmail.com 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


All times are GMT. The time now is 07:32 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.