I'm attempting to extract a link from html that looks something like this: <a class="email-link" href="https://app.myapp.com/results/a7696ced77454dd39d8241e79f981b3d">here</a>. using the xquery extractor. the x-query //a/@href seems to work in the online testers but not in FME. Any ideas?
Solved
extracting link from html xquery issue.
Best answer by debbiatsafe
Hi @johnglick
The rejection message on the rejected feature from XMLXQueryExtractor with the XQuery expression //a/@href is "...can not serialize attribute node".
Searching this error led to this StackOverflow answer. It seems the error is caused by serializing certain result types. Using either of the two functions mentioned in the answer, data() or string(), on the attribute does allow the XMLXQueryExtractor to successfully complete (eg. //a/data(@href) or //a/string(@href).
I'll note it is also possible to use the HTMLExtractor to extract URLs as an alternative to the XMLXQueryExtractor.
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.