This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Xalan Transformation Error


Thank You Carstein,
That was about the beyond the call of duty. I sincerely appreciate you helping  get me that information.

Scott

-----Original Message-----
From: Carsten Klein [mailto:carstenklein@yahoo.de]
Sent: Friday, June 14, 2002 1:38 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] Xalan Transformation Error


Hi Scott,

woah, that was a big stylesheet, I suppose, why don't you just split this
template into smaller templates. This could improve overall readability and
make debugging more easier =)

Okay, I found a bit of code which reads

<xsl:choose>
<xsl:when test="item_type[.='hidden']">
<input type="hidden">
<xsl:attribute name="name"><xsl:value-of
select="item_name"/></xsl:attribute>
<xsl:choose>
<xsl:when test="/ad/content_type[.='~default~']">
<xsl:attribute name="value"><xsl:value-of
select="default_contents"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="value"><xsl:value-of
select="user_contents"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>

here you use
<xsl:when test="item_type[.='hidden']">

perhaps you should check the lines where use use test expression like
these...I would guess
these are causing the error, since all other occurences of "hidden" and
"text" are within
<input type="..."/> nodes, which are, on first reading, well built.

Sorry, since I don't have an xml document as input, I can only guess
item_type is an attribute,
if so, why don't you just use <xsl:when test="@item_type='hidden'"/> ?

If this is a child node of the currently processed node, which one I wasn't
able to follow, since I
didn't have the will and time to check on your code that much, then why
don't you just use
(./item_type) = 'hidden'. The node will eventually be evaluated to a string,
thus you needn't use
that complicated an expression as the one above.

As long as the input document is formed as such, that the <item_type/> node
does not contain any
whitespace or other characters, e.g. carriage-return or else. If this is the
case, you should use an XPATH
function, e.g. xf:normalize-[...](node) to make this evaluation of the node
item_type always work correctly.

Have a look at the specification 'bout XQuery and XPath Functions, see

http://www.w3.org/TR/xquery-operators/

although this is a working draft, and an old one by that, it should give a
insight on what is possible regarding
string functions etc. Don't know if there is a newer version of that
document, though, it was hard enough to find the
old one  =)


Bye

Carsten


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]