Solved

Add to XSL so it disregards certain lines on incoming xml

Posted on 2012-03-30
4
266 Views
Last Modified: 2012-03-30
I have an XSL with a for-each select that ignores the text FRGT.  I need to add that it should also ignore FRGH.  How do I add it?

<xsl:for-each select="SorSalesOrderInvoiceDocuments/SalesOrderInvoiceDocument/Merchandise[MStockCode/text() != 'FRGT']">

Thank you
0
Comment
Question by:MrWeen
[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
  • 3
4 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 37788717
<xsl:for-each select="SorSalesOrderInvoiceDocuments/SalesOrderInvoiceDocument/Merchandise[not(MStockCode= 'FRGT') and not(MStockCode = 'FRGH')]">
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 37788734
two notes

- it is better to use not(... = ...) instead of ... !=... since equality in a predicate is a set compare
- you should not compare against the text() node because the text you are comparing against can be split in multiple text nodes

I usually compare against the normalized-space actually

<xsl:for-each select="SorSalesOrderInvoiceDocuments/SalesOrderInvoiceDocument/Merchandise[not(normalize-space(MStockCode)= 'FRGT') and not(normalize-space(MStockCode) = 'FRGH')]">
0
 

Author Closing Comment

by:MrWeen
ID: 37788810
Thank you.  This worked perfectly.  Thank you for the additional tips as well.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 37788975
welcome
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
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, …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

742 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