Question

Cannot get test filter to work despite knowing the same query parameters work on the SQL side

  • 5 December 2017
  • 3 replies
  • 5 views

I am parsing a very large xml file. After using the XML reader, my intention is to widdle down the data by using a series of constraints before writing to a database. I first tried to do this by stringing together multiple attribute filters, however I was unable to get my results from the first attribute filter transformer passed to my second, etc. Documentation suggests the Test filter would be a better route anyways. Despite knowing that my data satisfies the query statements (I tested this in another environment) I have added to the test filter transformer, I cannot get the transformer to pass any data through.

I have also tried to achieve the same task via stringing together testers, as well as stringing together test filters (1 statement a piece).

Does anyone know why I cannot get this to work? Thank you ahead of time for addressing this post.


3 replies

Userlevel 3
Badge +17
Hi @davedbaron1 Would you be able to post a small sample of your dataset and your workspace?
Badge +1

Hi @davedbaron1

Can you add an inspector right after your AttributeManager? This will allow you to verify if your attribute value combination exists in your workflow (e.g. the attribute values are read/manipulated as expected by FME). The Testfilter in this case should do the trick.

Badge +5

xml-record-2-testfilter.fmwHi @davedbaron1 were you able to solve?

I agree with @kd If you add an inspector between the AttrManager & TestFilter were you able to notice any leading or trailing whitespace characters in the inbound attributes you testing?

If there are (hidden/additional) string values You could perhaps add a "@Trim" statement in either the AttrMgr or in the individual test statements to remove leading and trailing whitespace.

If from XML is the source look for stray quote marks as well ' or " they will interfere with an exact string match.

and last resort you could change the testFilter = to a LIKE or CONTAINS or CONTAINS REGEX statement to loosen up the match until you find the offending attributes

Reply