[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xsl-list
Subject:    Re: [xsl] NMTOKENS problem
From:       "Craig Sampson craig.sampson () sas ! com" <xsl-list-service () lists ! mulberrytech ! com>
Date:       2015-02-12 20:38:56
Message-ID: 20150212153825.56886 () lists ! mulberrytech ! com
[Download RAW message or body]

Thanks to Christopher and Ken for the quick answers. I add a variable for the eid \
attribute value and got the results I was looking for. - Craig

              <xsl:for-each select="subSubTopic">
                <xsl:if test="@softwareContextID">
                  <xsl:variable name="myEID" select="@eid"/>
                  <xsl:for-each select="tokenize(@softwareContextID,' ')"> <!-- \
                NMTOKENS -->
                    <xsl:comment> token: <xsl:value-of select="."/></xsl:comment>
                    <xsl:if test="upper-case(.)!='DEFAULTLANDINGPAGE'">
                      <context contextMappingID="{.}" docset="{$alias}" \
file="{$deliverable}.htm#{$myEID}"/>  </xsl:if>
                  </xsl:for-each> <!-- NMTOKEN -->
                </xsl:if>
              </xsl:for-each>  <!-- subSubTopic -->

-----Original Message-----
From: G. Ken Holman [mailto:g.ken.holman@gmail.com] On Behalf Of G. Ken Holman
Sent: Thursday, February 12, 2015 3:32 PM
To: xsl-list@lists.mulberrytech.com; xsl-list@lists.mulberrytech.com
Cc: Craig Sampson
Subject: Re: [xsl] NMTOKENS problem

At 2015-02-12 20:11 +0000, Craig Sampson craig.sampson@sas.com wrote:
> Can anyone tell me what the problem is and how to fix it?

I can tell you why you get the error (don't kick yourself too hard), but how to fix \
it is up to you based on what you need.

> <xsl:for-each select="tokenize(@softwareContextID,' ')">

That sets the context to be a string.

> <context contextMappingID="{.}" docset="{$alias}" 
> file="{$deliverable}.htm#{@eid}"/>

And there you are trying to obtain the eid= attribute of the string.

And so you get the message:

> Required item type of the context item for the attribute axis is 
> node(); supplied value has item type xs:string

My guess is you'll have to put the @eid into a variable when the context is \
subSubTopic before tokenizing and then use the variable.

I hope this helps.

. . . . . . . Ken

--
Check our site for free XML, XSLT, XSL-FO and UBL developer resources | Free 5-hour \
lecture:  http://www.CraneSoftwrights.com/links/video.htm | Crane Softwrights Ltd.    \
http://www.CraneSoftwrights.com/s/ | G. Ken Holman                    \
mailto:gkholman@CraneSoftwrights.com | Google+ profile:       \
http://plus.google.com/+GKenHolman-Crane/about | Legal business disclaimers:     \
http://www.CraneSoftwrights.com/legal |


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/651070
or by email: xsl-list-unsub@lists.mulberrytech.com
--~--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic