The  <[CDATA[ .... ]]>  bracketing simply tells the xml parser to read the 
enclosed text as raw text.  This allows you to use embedded characters like < 
and >, and is quite handy when the text is code fragments which can contain a 
lot of these special characters.  (It allows you to cut and paste into XML.)

The resulting parsed xml document is identical whether you use entities to 
escape individual characters or use CDATA.

If your program writes the document out again, the CDATA will be gone and the 
corresponding text in the resulting document will escape individual characters 
with  entities like &gt; and &lt;.

Stan
-----Original Message-----
From: gret...@gmail.com [mailto:gret...@gmail.com] On Behalf Of Grant Rettke
Sent: Thursday, April 23, 2009 4:39 PM
To: Maven Users List
Subject: Re: Challenge: Find a plugin combo that achieves what 4 lines of bash 
script can do...

On Thu, Apr 23, 2009 at 11:03 AM, Stan Devitt <sdev...@rim.com> wrote:
>           <plugin>
>               <groupId>org.codehaus.groovy.maven</groupId>
>               <artifactId>gmaven-plugin</artifactId>
>               <executions>
>                <execution>
>                 <phase>generate-resources</phase>
>                 <goals>
>                   <goal>execute</goal>
>                 </goals>
>                 <configuration>
>                   <source>
>                   <![CDATA[
> new File( "target" ).mkdirs();
> def resultfile = new File( "target/dictionary" );
> new File("src/main/dictionary").eachFileMatch(~/.*\.lst/){ file ->
>  file.readLines().sort().each(){resultfile << it.trim() + "\n";}
> }
>                   ]]>
>                   </source>
>                 </configuration>
>                </execution>
>               </executions>
>           </plugin>

http://groovy.codehaus.org/GMaven+-+Executing+Groovy+Code#GMaven-ExecutingGroovyCode-ExecuteanInlineGroovyScript

Why is the CDATA in there?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential 
information, privileged material (including material protected by the 
solicitor-client or other applicable privileges), or constitute non-public 
information. Any use of this information by anyone other than the intended 
recipient is prohibited. If you have received this transmission in error, 
please immediately reply to the sender and delete this information from your 
system. Use, dissemination, distribution, or reproduction of this transmission 
by unintended recipients is not authorized and may be unlawful.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to