Syntax 如何在yml文件中使用内部引用

Syntax 如何在yml文件中使用内部引用,syntax,yaml,Syntax,Yaml,我有这样一个yml文件: jvm_config: tomcat_port: 1066 jvm_opts: "-Dcom.sun.management.jmxremote.port=10667" 我想要这样的东西 jvm_config: tomcat_port: 1066 jvm_opts: "-Dcom.sun.management.jmxremote.port=${tomcat_port}7" 在xml中它可以工作,但在yml中如何工作?PyYAML可以加载它(因此我希

我有这样一个yml文件:

jvm_config: 
  tomcat_port: 1066
  jvm_opts: "-Dcom.sun.management.jmxremote.port=10667"
我想要这样的东西

jvm_config: 
  tomcat_port: 1066
  jvm_opts: "-Dcom.sun.management.jmxremote.port=${tomcat_port}7"

在xml中它可以工作,但在yml中如何工作?

PyYAML可以加载它(因此我希望libyaml可以工作)。你用什么来解析它?或者您希望替换tomcat_port的值吗?可能重复使用YAML自定义标记的See my answer-simple方法-