Comment stocker un document XML sous Mac OS X ?

Tout d'abord, j'ai ouvert TextEdit. Je suis allé au menu Format et j'ai défini l'option -> Créer du texte brut, J'ai entré les données suivantes, qui doivent être requises dans ma demande.

<?xml version="1.0" encoding="ISO-8859-1"><tips><Prop_Tips><Tip_ID><![CDATA[1]]></Tip_ID><Category_ID>1</Category_ID><Tip_Title>Play Your Shot</Tip_Title><Tip_Thumb>http://192.168.32.212/jalpesh/igolf/TipThumb/PlayyrshotThumb.jpg</Tip_Thumb><Tip_image>http://192.168.32.212/jalpesh/igolf/TipImage/Playyrshot.jpg</Tip_image><Tip_Description>Every golfer likes to hit the ball long, high and straight, but experience tells you that you can expect a certain pattern to your shots.</Tip_Description><Category_Name>Course Management/Strategy</Category_Name></Prop_Tips><Prop_Tips><Tip_ID><![CDATA[2]]></Tip_ID><Category_ID>1</Category_ID><Tip_Title>Shots Curve From Sidehill Lies</Tip_Title><Tip_Thumb>http://192.168.32.212/jalpesh/igolf/TipThumb/Shots-Curve-From-Sidehill-LiesThumb.jpg</Tip_Thumb><Tip_image>http://192.168.32.212/jalpesh/igolf/TipImage/Shots-Curve-From-Sidehill-Lies.jpg</Tip_image><Tip_Description>Sidehill fairway lies will cause the ball to curve, slice right or hook left. Here's a tip to help make better contact.</Tip_Description><Category_Name>Course Management/Strategy</Category_Name></Prop_Tips></tips>

Après avoir enregistré ce fichier en UTF-8, Chaque fois que j'ai essayé de lire mon fichier XML via XMLParser, je reçois les données suivantes du fichier

{rtf1ansiansicpg1252cocoartf949cocoasubrtf460
{fonttblf0fmodernfcharset0 Courier-Bold;}
{colortbl;red255green255blue255;}
margl1440margr1440vieww9000viewh8400viewkind0
pardtx480tx960tx1440tx1920tx2400tx2880tx3360tx3840tx4320tx4800tx5280tx5760tx6240tx6720tx7200tx7680tx8160tx8640tx9120tx9600tx10080tx10560tx11040tx11520tx12000tx12480tx12960tx13440tx13920tx14400tx14880tx15360tx15840tx16320tx16800tx17280tx17760tx18240tx18720tx19200tx19680tx20160tx20640tx21120tx21600tx22080tx22560tx23040tx23520tx24000tx24480tx24960tx25440tx25920tx26400tx26880tx27360tx27840tx28320tx28800tx29280tx29760tx30240tx30720tx31200tx31680tx32160tx32640tx33120tx33600tx34080tx34560tx35040tx35520tx36000tx36480tx36960tx37440tx37920tx38400tx38880tx39360tx39840tx40320tx40800tx41280tx41760tx42240tx42720tx43200tx43680tx44160tx44640tx45120tx45600tx46080tx46560tx47040tx47520tx48000qlqnaturalpardirnatural

f0bfs24 cf0 CocoaLigature0 <?xml version="1.0" encoding="ISO-8859-1"?>
    <tips><Prop_Tips><Tip_ID><![CDATA[1]]></Tip_ID><Tip_Title>Play Your Shot</Tip_Title><Tip_Description>Every golfer likes to hit the ball long, high and straight, but experience tells you that you can expect a certain pattern to your shots.</Tip_Description></Prop_Tips><Prop_Tips><Tip_ID><![CDATA[2]]></Tip_ID><Tip_Title>Shots Curve From Sidehill Lies</Tip_Title><Tip_Description>Sidehill fairway lies will cause the ball to curve, slice right or hook left. Here's a tip to help make better contact.</Tip_Description></Prop_Tips><Prop_Tips><Tip_ID><![CDATA[3]]></Tip_ID><Tip_Title>Don't Ground The Driver</Tip_Title><Tip_Description>Keep the clubhead just off the ground to get your swing off to a consistently smooth start.</Tip_Description></Prop_Tips><Prop_Tips><Tip_ID><![CDATA[4]]></Tip_ID><Tip_Title>Tilt Your Tee</Tip_Title><Tip_Description>Here's a tip to "max out" into-the-wind drives.</Tip_Description></Prop_Tips></tips>}

Ce qui indique que le fichier n'est pas stocké dans le format approprié.

Je veux simplement enregistrer un fichier XML en utilisant TextEdit sous Mac OS X.

demandé sur