[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|