Solved

XSL variable help -- not(contains(..  ?

Posted on 2014-10-03
7
153 Views
Last Modified: 2014-10-04
Hi,

   I have the following XSL below and its not quite right.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="mmname" select="normalize-space(attr[@tag='00081090'])"/>
 <xsl:template match="/dataset">
	<xsl:choose>
	  <xsl:when test="$mmname,not(contains('IntelliSpace PACS'))">
		 <destination aet="GINKGO_JH" priority="high"/>
	  </xsl:when>
	</xsl:choose>
 </xsl:template>
</xsl:stylesheet>

Open in new window


I know that there is something wrong when I'm calling the variable, but here is what I am wanting to accomplish.
When the variable $mmname does NOT contain 'IntelliSpace PACS' I want to do what is after the <xsl: when test>  I just don't know how to properly place eveything in the the '<xsl:when test' line.  Do I need an equals in between the variable or how would be the best way to go about this?

I can't tell it:  <xsl:when test!="$mmname='IntelliSpace PACS'"> because sometimes the last word changes.

What the variable is doing above is getting the value from the attr tag '00081090'

thanks
0
Comment
Question by:doc_jay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 40360964
<xsl:when test="not(contains($mmname, 'IntelliSpace PACS'))">
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 40360965
contains is a function that takes two argumenst, like shown above
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 40360966
You have not shown us the XML but

<xsl:variable name="mmname" select="normalize-space(attr[@tag='00081090'])"/>
conflicts with
<xsl:template match="/dataset">

the root is either "attr" or "dataset" but not both

I guess (without seeing the source XML) that you need
<xsl:variable name="mmname" select="normalize-space(//attr[@tag='00081090'])"/>
0
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 

Author Comment

by:doc_jay
ID: 40361369
Yes, your right.  showing all of the XML would  make a lot of difference.  I apologize!

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="mmname" select="normalize-space(attr[@tag='00081090'])"/>
 <xsl:template match="/dataset">
	  </xsl:if> -->
	<xsl:choose>
	  <xsl:when test="$mmname,not(contains('IntelliSpace PACS'))">
		 <destination aet="GINKGO_JH" priority="high"/>
	  </xsl:when>
	</xsl:choose>
 </xsl:template>
</xsl:stylesheet>

Open in new window

0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 40361390
I actually meant the source XML :-)
the XSLT was clear to me

did you try the two suggested changes? It should work
0
 

Author Comment

by:doc_jay
ID: 40361391
Just tried it out and yes, it compiled great this time!  thank you
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 40361422
welcome
0

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question