[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

<option selected> breaking xsl?

Subject: <option selected> breaking xsl?
From: elizabeth Hostetter <aellath@xxxxxxxxxxxxx>
Date: Thu, 6 Oct 2011 10:31:27 -0700
 <option selected> breaking xsl?
i'm creating a dropdown that is populated by page numbers determined by xsl and a number of items per page. i've got the dropdown working with the js and xsl, but now i'm trying to have the *current* page be the one that displays when the dropdown is created (so if i'm on page 4, "4" is the pre-selected option in the dropdown.

i know the attribute in html is <option selected> -- but it causes an xsl transform error every time. i know this, because i've taken just that one attribute out of my code, and the code doesn't break.

<code>
<!-- dropdown page menu -->
<select id="pageMenu" onChange="turnPage();">
<xsl:for-each select="//PageOffset">
<xsl:choose>
<xsl:when test=". != ../CurrentItemOffset">
<option><xsl:value-of select="position()"/></option>
</xsl:when>
<xsl:otherwise>
<option selected><xsl:value-of select="position()" /></ option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</code>


If i take out the 'selected' attribute in the <xsl:otherwise> clause, the page loads normally. Obviously, the choose block is pointless if i do that, though!

i'm positing that the transform is choking on the 'selected' because it looks like the 'select' attribute in xsl - but it's not in an xsl tag, so why?

Of course, just like last time, the error message is not helpful:
<blockquote>
XSL Transform Error:
java.lang.Exception: org.xml.sax.SAXParseException: character not allowed
Message:org.xml.sax.SAXParseException: character not allowed
</blockquote>


can anyone tell me why 'selected' is breaking the page, and if there's a way to do this?

thank you!
aellath

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.