|
Subject: Re: [xsl] Suggestions for filtering algorithm From: "Rick Quatro rick@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 18 Dec 2019 15:29:50 -0000 |
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Suggestions for filtering alg, Rick Quatro rick@xxx | Thread | Re: [xsl] Suggestions for filtering, Martin Honnen martin |
| Re: [xsl] Running the same transfor, Trevor Nicholls trev | Date | Re: [xsl] Suggestions for filtering, Martin Honnen martin |
| Month |