💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# C.115 XmlPropertyTask Loads property values from a well-formed xml file. There are no other restrictions than "well-formed". Table C.149:聽Attributes NameTypeDescriptionDefaultRequired`file``String`The XML file to parse.n/aYes`prefix``String`The prefix to prepend to each propertyn/aNo`keepRoot``Boolean`Keep the xml root tag as the first value in the property name.`true`No`collapseAttributes``Boolean`Treat attributes as nested elements.`false`No`delimiter``String`Delimiter for splitting multiple values.,No`required``Boolean`If this is set to `true` then a build exception will be raised if the file cannot be found otherwise only a warning will be logged.`false`No C.115.1 Example Consider the following XML file: ``` <root-tag myattr="true"> <inner-tag someattr="val">Text</inner-tag> <a2><a3><a4>false</a4></a3></a2> </root-tag> ``` Used with the following entry (**default**): `<xmlproperty file="somefile.xml"/>`results in the following properties: ``` root-tag(myattr)=true root-tag.inner-tag=Text root-tag.inner-tag(someattr)=val root-tag.a2.a3.a4=false ``` Used with the following entry (`collapseAttributes=true`): `<xmlproperty file="somefile.xml" collapseAttributes="true"/>`results in the following properties: ``` root-tag.myattr=true root-tag.inner-tag=Text root-tag.inner-tag.someatt=val root-tag.a2.a3.a4=false ``` Used with the following entry (`keepRoot=false`): `<xmlproperty file="somefile.xml" keepRoot="false"/>`results in the following properties: ``` inner-tag=Text inner-tag(someattr)=val a2.a3.a4=false ```