| ||||||||
AddElem and SetData FlagsSetData always had a CDATA Section flag The flags in AddChildElem, InsertElem and InsertChildElem work the same as in MNF_WITHCDATAFormerly indicated by passing a xml.AddElem( "J", "78&6>5<9", CMarkup::MNF_WITHCDATA ); Produces: <J><![CDATA[78&6>5<9]]></J>
CString csData = xml.GetData(); // csData == "78&6>5<9" MNF_WITHREFSPass the CMarkup xml; xml.AddElem( "D" ); xml.AddChildElem( "R", "国" ); xml.AddChildElem( "R", "国", CMarkup::MNF_WITHREFS ); <D>
<R>&#22269;</R>
<R>国</R>
</D>
xml.ResetChildPos(); xml.FindChildElem(); CString csData = xml.GetChildData(); // csData == "国" xml.FindChildElem(); csData = xml.GetChildData(); // csData == "国" MNF_WITHNOLINESThe CMarkup xml; xml.AddElem( "D" ); <D/>
Normally, if an element is created inside it, the element is put on a separate line in between the start and end tags of the parent element. xml.IntoElem(); xml.AddElem( "R", 120 ); <D>
<R>120</R>
</D>
But if instead the xml.IntoElem(); xml.AddElem( "R", 120, CMarkup::MNF_WITHNOLINES ); <D><R>120</R></D>
MNF_WITHNOENDFor HTML and ill-formed XML purposes, pass the xml.AddElem( "P", "", CMarkup::MNF_WITHNOLINES ); xml.IntoElem(); xml.AddNode( CMarkup::MNT_TEXT, "First line" ); xml.AddElem( "BR", "", CMarkup::MNF_WITHNOEND | CMarkup::MNF_WITHNOLINES ); xml.AddNode( CMarkup::MNT_TEXT, "Second line" ); <P>First line<BR>Second line</P>
With HTML, xml.AddElem( "P", "", CMarkup::MNF_WITHNOLINES ); xml.SetElemContent( "First line<BR>Second line" ); MNF_WITHXHTMLSPACETo create an XHTML compliant document, use the xml.InsertElem( "br", "", CMarkup::MNF_WITHXHTMLSPACE ); The xml.AddElem( "p", "", CMarkup::MNF_WITHNOLINES ); xml.SetElemContent( "First line<br />Second line" ); <p>First line<br />Second line</p>
|
|
Posted July 12, 2005. Question or comment about this article? ©Copyright 2008 First Objective Software, Inc. All rights reserved. |