I'm writing a program which fetches a WSDL and any imported files, then saves them to a single directory. What I want to do as part of this is to flatten the file structure so there's just one directory which contains all the files referenced by the WSDL or referenced by its referenced files. So I need to go into each file and wherever there's an import, I need to strip the path out of the name. Here's an example:
<xsd:import schemaLocation="xsds/Currency.xsd" namespace="urn:example.com:enterprise:schemas:reference:currency"> </xsd:import>
So the import above references the file
xsds/Currency.xsd and I want to just extract
Currency.xsd from this. I can get the content of this attribute with an XPath expression to match the tag like so:
However, there are probably other types of tags where a WSDL or it's referenced xsds might import files which this XPath expression won't match. What are the other tags or field names I might need to match on so I don't miss any files?