1

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?

Emil Lundberg
  • 7,268
  • 6
  • 37
  • 53
  • As a workaround for this particular use case, I've currently resorted to specifying the configuration using a nested `` element instead, since then I don't need any `>`s in attribute values. – Emil Lundberg Sep 06 '13 at 14:54

1 Answers1

1

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.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102