droyo / go-xml

utility and code-generation libraries for XML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

replace rule not working to create shared types

adamdecaf opened this issue · comments

I'm trying to generate Go code from some ISO20022 xsd files and running into an issue. Replace rules are supposed to take the form of regex -> regex, right?

Running this and lots of other variations seems to replace nothing. Without type and string I can see replacements. Escaping the special characters doesn't seem to help.

xsdgen \
  -pkg foo \
  -r 'type Max(\d*)Text string -> type Max${1}Text common.Max${1}Text' \
  -o gen/head_001_001_03/head_001_001_03.go \
  ./xsd/head.001.001.03.xsd

I'm trying to use shared types common package to enhance validation / formatting.