what-is-the-purpose-of-CDATA

  • mybatis sql๋ฌธ์—์„œ ์ข…์ข… ๋ณด๋˜ ๊ตฌ๋ฌธ.

  • ํ•ด๋‹น ๊ตฌ๋ฌธ์€ ์™œ ํ•„์š”ํ•œ๊ฐ€?

์ •์˜

  • ๋ฌธ์žํ˜• ๋ฐ์ดํ„ฐ (Character data)

  • ํŠน์ˆ˜ ๋ฌธ์ž๋ฅผ ๋ฌธ์ž์—ด๋กœ ์ธ์‹ํ•˜๋„๋ก ํ•˜๋Š” ๊ธฐ๋Šฅ

์˜ˆ์‹œ

<select id="findAll" resultMap="MemberResultMap">
 
    select *
 
    from employees
 
    where salary > 100
 
</select>
  • ์—๋Ÿฌ๋‚จ

    • ์™œ? salary > 100 ์—์„œ > ๋ฅผ '๋น„๊ต์—ฐ์‚ฐ์ž' ๋กœ ์ธ์‹ํ•˜๊ธฐ ๋•Œ๋ฌธ

  • ์ด๋ฅผ ๋ง‰๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ๋“ฏ

์ •๋ฆฌ

  • XML markup์œผ๋กœ ํ•ด์„๋˜๋ฉด ์•ˆ๋˜๋Š”๋ฐ, ํ•ด์„๋˜๋Š” ๋ฌธ์ž์—ด๋“ค์ด ์ฟผ๋ฆฌ ๋ฌธ์— ์žˆ๊ธฐ ๋•Œ๋ฌธ์—, ์ด๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋Š” ์„ ์–ธ.

  • ๋ฐ˜๋ณต๋ฌธ์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ.. ์•„๋ž˜ ๋ณด๋‹จ

    <example-code>
    while (x &lt; len &amp;&amp; !done) {
        print( &quot;Still working, &apos;zzz&apos;.&quot; );
        ++x;
        }
    </example-code>
  • ์ด๊ฒŒ ๋‚ซ๋‹ค. (๊ฐ€๋…์„ฑ ๋“ฑ..)

    <example-code><![CDATA[
    while (x < len && !done) {
        print( "Still working, 'zzzz'." );
        ++x;
        }
    ]]></example-code>

์ฐธ๊ณ 

  • https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

  • https://gdtbgl93.tistory.com/53

  • https://epthffh.tistory.com/entry/Mybatis-%EC%97%90%EC%84%9C-CDATA-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0

Last updated