Solved

Add to XSL so it disregards certain lines on incoming xml

Posted on 2012-03-30
4
254 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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, …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now