XML : Parameter DTD for dynamic XML?

Maybe this is some task for XML and DTD gurus? Hope you can help me out of my dark.

my XML file needs either this DTD entity

    <!-- testing -->    &test-commonTestingLibs;    

or this

    <!-- testing -->    &compile-commonTestingLibs;    

my DTD for is looks like this for the test-*

  <!ENTITY test-commonTestingLibs "    <dependency org='org.dbunit' name='dbunit' rev='${lib.version.dbunit}' conf='test->default, sources, javadoc' />      <dependency org='org.testng' name='testng' rev='${lib.version.testng}' conf='test->default, sources, javadoc' />  " >    

or for the compile-*

  <!ENTITY compile-commonTestingLibs "    <dependency org='org.dbunit' name='dbunit' rev='${lib.version.dbunit}' conf='compile->default, sources, javadoc' />      <dependency org='org.testng' name='testng' rev='${lib.version.testng}' conf='compile->default, sources, javadoc' />  " >    

Is it possible to define a DTD which makes the identical code more reusable with a parameter "aParameter"?

  <!ENTITY commonTestingLibs-%%aParameter%% "    <dependency org='org.dbunit' name='dbunit' rev='${lib.version.dbunit}' conf='%%aParameter%%->default, sources, javadoc' />      <dependency org='org.testng' name='testng' rev='${lib.version.testng}' conf='%%aParameter%%->default, sources, javadoc' />  " >    

so I could either do a entity definition with the aParameter in the DTD or in the XML as a param?

This would help me to eliminiate redundant definitions, which often are not so short as the example above and the difference is exactly only one simple keyword "aParameter" (mostly: compile, test, provided, ...)

No comments:

Post a Comment