Hi @edhere,
I tried to look this URL in my browser but its wrong.
Hi @edhere, what kind of data do you like to make download?
Danilo
For me, its working with the browser and HTTPCaller (the _response_body attribute contains the returned XML).
When you say "no luck", what happens? Is there a crash? An error message? Or just a feature is output with no data? Can you post a screenshot of the transformer parameters, so that we can see what settings you are using? Thanks!
Hi @edhere,
I tried to look this URL in my browser but its wrong.
I tried it now in my machine and its works.
Hi all,
Thanks for your responses. I have updated the start post with more info.
Hope this makes sense.
Thanks,
Ed
Hi @edhere,
> What transformers should I use next?
Generally you can use the XMLFragmenter and/or the XMLFlattener to extract some values contained by an XML document as feature attributes. In some cases, the XMLXQueryExploder or the XMLXQueryExtractor could also be helpful. The concrete solution depends on how you need to interpret the XML document.
Hello @edhere , would you be able to let us know which data you are looking for in the xml? Would you be able to be specific? If it is one value you could extract the information using a regular expression, otherwise if it is more complex then it is better to consider it as an XML file and use xml handlng transformers. Those are the traansformers cited by @takashi
Hi, gisinnovationsb
I've checked the XML contained in the _response_body, let's start with:
<dcterms:title>*randomtext*</dcterms:title>
<url>*randomurl*</url>
How would I extract the data in title and url?
Many thanks,
Ed
Hello @edhere , would you be able to let us know which data you are looking for in the xml? Would you be able to be specific? If it is one value you could extract the information using a regular expression, otherwise if it is more complex then it is better to consider it as an XML file and use xml handlng transformers. Those are the traansformers cited by @takashi
Hi, gisinnovationsb
I've checked the XML contained in the _response_body, let's start with:
<dcterms:title>*randomtext*</dcterms:title>
<url>*randomurl*</url>
How would I extract the data in title and url?
Many thanks,
Ed
Hi @edhere,
> What transformers should I use next?
Generally you can use the XMLFragmenter and/or the XMLFlattener to extract some values contained by an XML document as feature attributes. In some cases, the XMLXQueryExploder or the XMLXQueryExtractor could also be helpful. The concrete solution depends on how you need to interpret the XML document.
If you need to extract the values of the descendant elements (e.g. <title>, <url>) of the <record> element for each record, the XMLFragmenter with this setting might help you.
Just be aware the transformer would also extract unexposed attributes other than title and url. You can use FME Data Inspector (Feature Information Window) to check all the attributes that the resulting feature contains.
Hello @edhere , would you be able to let us know which data you are looking for in the xml? Would you be able to be specific? If it is one value you could extract the information using a regular expression, otherwise if it is more complex then it is better to consider it as an XML file and use xml handlng transformers. Those are the traansformers cited by @takashi
hi @edhere,
Is this correct?
hi @edhere,
Is this correct?
The idea is to read the url from an xml reader and not the httpCaller. I am using FME 2016. Attached is the workspace.
When you click on the parameters button, you will be able to filter any node from the xml file you wish to gain access to.
hi @edhere,
Is this correct?
xml2none.fmw
Hi, gisinnovationsb
I've checked the XML contained in the _response_body, let's start with:
<dcterms:title>*randomtext*</dcterms:title>
<url>*randomurl*</url>
How would I extract the data in title and url?
Many thanks,
Ed
Answered above
@edhere Ed - the approach you take really does depend on what data you want to extract. But the general steps are:
- use the approach you already have to read your query from Excel.
- determine the the XML node that you want to split your records - it looks like it would be either:
- searchRetrieveResponse/records/record or
- searchRetrieveResponse/records/record/recordData
Tip: if you don't know the XML very well then add the XML reader and use the XML Elements to Match reader tree view to browse the XML to find the appropriate tag:
cut and paste the Selected Items. Once you have the selected item, cancel everything (i.e. don't actually add the XML reader to the workspace)
- use either HTTPCaller (with XMLFragmenter) OR use the FeatureReader - I think I'd suggest FeatureReader
- FeatureReader:
- add the XML reader, Dataset: <attribute with URL>,
- Parameters: Elements to Match: <selected items>, i.e. searchRetrieveResponse/records/record,
- Flatten Options: Enable Flattening
- HTTPCaller & XMLFragmenter will be more or less the same.
Example Workspace attached: xmlreader.fmw
There's a pretty good XML Tutorial on the KnowledgeCentre that covers many of these topics..