[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] <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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|