[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Suggestions for filtering algorithm

Subject: Re: Suggestions for filtering algorithm
From: "Rick Quatro rick@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Dec 2019 15:29:50 -0000
Re:  Suggestions for filtering algorithm
Here is my attempt at filtering by getting a regular expression pattern to
apply against my input. Here is the filter document:

 

<?xml version="1.0" encoding="UTF-8"?>

<filter>

    <exclude>HOSE ASSEMBLY</exclude>

    <exclude>HOSE ASSY</exclude>

    <exclude>HOSE SEGMENT</exclude>

    <exclude>SHIM SET</exclude>

    <exclude>STUD</exclude>

    <exclude>PIPE SEGMENT</exclude>

    <exclude>MANIFOLD-WATER</exclude>

</filter>

 

And here is my XSLT shell:

 

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    xmlns:xs="http://www.w3.org/2001/XMLSchema"

    xmlns:rq="http://www.frameexpert.com/functions"

    exclude-result-prefixes="xs"

    version="2.0">

    

    <xsl:variable name="excludes-regex-pattern">

        <xsl:value-of select="rq:getRegex(doc('Parts_Filter.xml'))"/>

    </xsl:variable>

    

    <xsl:template match="/">

        <xsl:message select="$excludes-regex-pattern"></xsl:message>

    </xsl:template>

    

    <xsl:function name="rq:getRegex">

        <xsl:param name="excludes"/>

        <xsl:text>(</xsl:text>

        <xsl:value-of select="$excludes/descendant::exclude" separator="|"/>

        <xsl:text>)</xsl:text>

    </xsl:function>

    

</xsl:stylesheet>

 

Any comments and suggestions are welcome. Thanks.

 

Rick

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.