Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML file size increases GREATLY with <![CDATA[

Status
Not open for further replies.

maguskrool

Technical User
Dec 11, 2006
77
PT
I have several .xml files that provide info for a website of mine and was quite surprised to discover, while I was uploading them, that some of them were around 60-70kb, while others were 4kb or less. Knowing that the amount of content in all of them doesn't vary that much, I noticed that the biggest file sizes corresponded to the files using <![CDATA[ ]]>.

I included a sample file code below. It's in Portuguese, but I think it's still obvious that this file could not be more than a few kb, and Dreamweaver saves it with a whopping 62kb!

I tried saving the exact same file in text edit and it resulted in a normal file size.

Has anyone encountered similar situations? I'm guessing this is some sort of bug, that Dreamweaver puts some extra content - somewhere - because of the CDATA. Is there any sort of reason or fix for this?

Thanks in advance.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML by vivóeusébio - [URL unfurl="true"]www.vivoeusebio.com[/URL] - 04-03-2008 -->
<!-- Itens do menu de línguas -->
<lista_itens_menu>
  <!-- Português -->
  <item_menu>
    <nome>
      <![CDATA[<span class="item_menu_02">PT</span>]]>
    </nome>
    <funcao>
      <tipo>língua</tipo>
      <valor>português</valor>
    </funcao>
    <itens_submenu></itens_submenu>
  </item_menu>
  <!-- Inglês -->
  <item_menu>
    <nome>
      <![CDATA[<span class="item_menu_02">EN</span>]]>
    </nome>
    <funcao>
      <tipo>língua</tipo>
      <valor>inglês</valor>
    </funcao>
    <itens_submenu></itens_submenu>
  </item_menu>
</lista_itens_menu>


 
Ok... embarassing moment. Just realized that DW CS3 is not guilty. In Leopard, in the file's Get Info panel, I changed the preferred application to open it, and the file's size changed according to different applications. Reverting back to DW CS3, it still resulted in the 60-70kb size, but deleting the file and saving a new one it the same name solved the problem.

Sorry guys.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top