質問

I'm writing a Gradle build script that is to build an Ivy module descriptor. I need a Node like

<dependency [...] conf="default->foo"/>

I would like to do this:

node.dependencies[0].appendNode("dependency", [
                        // [...]
                        conf: "default->${dep.configuration}",
                        ])

where node is a Node instance and dep.configuration == 'foo'. But it comes out as

<dependency [...] conf="default-&gt;foo"/>

Is there a comfortable way to create a Node without escaping >s in attribute values?

役に立ちましたか?

解決

Ivy uses an XML parser to read the module descriptor and so it will not complain about the &gt; entity reference. While > in attribute values is valid XML, the JAXP serialization does not print it that way and there is no way to configure it.

If you want to change this for aesthetic reasons, you would have to replace it after the XML file has been written.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top