Question

How to handle XSD with XMLFormatter ?

  • 19 February 2014
  • 5 replies
  • 2 views

Badge
Hi,

 

 

We are 2 developpers and we want to share some Custom Transformer (CT) with other users.

 

 

One of thouse (CT) use a XMLFormatter to check an XML.

 

 

Our problem is we (developpers) and users haven't got the same installation, shared directory etc...but the XMLFormatter keep the absolute path of the XSD and not a relativ path.

 

 

For us (dev) it's not a problem (just a pain...) but for our user it is.

 

 

So we tried using a parameter (for the XSD location)... but in this case, when we publish on the FMEServer do not publish the XSD...

 

 

How should we use it ?

 

Can we publish (with our hands) the XSD on the server ?

 

 

 


5 replies

Userlevel 4
Hi,

 

 

have you tried to specify a relative path, like:

 

 

$(FME_MF_DIR)my_schema.xsd

 

 

FME_MF_DIR is an internal parameter that points to the same directory as the running workspace.

 

 

For FME Server 2014 you should look into the new storage model for external resources. More details on the latest blog entry: http://blog.safe.com/2014/02/fmeevangelist124/ (item no. 6)

 

 

David
Badge
Hi David (again :) ),

 

 

Actually (in FME 2013) this does not work.

 

 

I cannot specify annything like: $(FME_MF_DIR)my_schema.xsd

 

$(FME_MF_DIR)/my_schema.xsd

 

$(FME_MF_DIR)$(FOO)

 

The XMLFormatter mark the "External Schema" field in red and I cannot validate the formatter box.

 

 

PS: I haven't try using a reference to a global parameter... I'm trying.
Userlevel 4
Hi,

 

 

just use an AttributeCreator to create an attribute containing the XSD filename, then reference this attribute in the XMLFormatter.

 

 

David
Badge
Hello again !

 

 

I can access to the variable value: thanks David !

 

 

But, my problem is the var FME_MF_DIR; it point to the directory of the current work space.

 

It could be useful but not in my case.

 

 

The problem is this: we've got plenty of work space (sometimes on users machine etc...) all of them useing the linked Custom Transformer.

 

 

I can't rely on the path of the workspace; only the path of the CustomTransformer and/or Shared Resource Directories (where my CustomTransformer are stored).

 

 

How can I do ?
Userlevel 4
Hi,

 

 

one idea might be to base the XSD path on FME_HOME rather than FME_MF_DIR. You can then install the XSD in a subdirectory there.

 

 

David

Reply