Aug 18, 2004 #1 ajikoe Programmer Apr 16, 2004 71 ID Hello, I would like to make XML comment but it include a symbol <. How can I treat it literally? Example: <remarks>Helo <world> </remarks> Thanks Pujo
Hello, I would like to make XML comment but it include a symbol <. How can I treat it literally? Example: <remarks>Helo <world> </remarks> Thanks Pujo
Aug 18, 2004 1 #2 link9 Programmer Nov 28, 2000 3,387 US You would need to use the CDATA construct: <remarks><![CDATA["Helo <world> "]]></remarks> More info: http://www.w3schools.com/xml/xml_cdata.asp -paul The answer to getting answered -- faq855-2992 Upvote 0 Downvote
You would need to use the CDATA construct: <remarks><![CDATA["Helo <world> "]]></remarks> More info: http://www.w3schools.com/xml/xml_cdata.asp -paul The answer to getting answered -- faq855-2992
Aug 18, 2004 1 #3 sacheson Programmer Mar 30, 2000 55 US or you can use entity references: e.g. '>' and '<' notation. " == " & == & http://www.w3schools.com/html/html_entitiesref.asp ______________________________________________ When told, "goto hell", a programmer finds the method, not the destination as harmful. Upvote 0 Downvote
or you can use entity references: e.g. '>' and '<' notation. " == " & == & http://www.w3schools.com/html/html_entitiesref.asp ______________________________________________ When told, "goto hell", a programmer finds the method, not the destination as harmful.
Aug 18, 2004 #4 JohnYingling Programmer Mar 24, 2001 3,742 US If you are writing XML, you xcan avoid trouble by using the XMLTextWriter. Dim sb As New StringBuilder(150) Dim sw As New IO.StringWriter(sb) Dim xtW As New Xml.XmlTextWriter(sw) xtW.WriteStartElement("SDPCIP30") xtW.WriteStartElement("TSHeader") xtw.WriteElementString("SerNbr", _ TrimNumber(m_d.SerialNbr).PadLeft(10, "0"c)) xtW.WriteEndElement() xtW.WriteEndElement() xtW.Close() Dim sXml as String = sb.Tostring http://www.VBResizer.com Forms/Controls Resizing/Tabbing http://www.VBCompare.com Compare Code http://www.VBSortGen.com Generate Sort Class in VB http://www.Vbcompare.com/Check.Htm(1979 Check To MS) Upvote 0 Downvote
If you are writing XML, you xcan avoid trouble by using the XMLTextWriter. Dim sb As New StringBuilder(150) Dim sw As New IO.StringWriter(sb) Dim xtW As New Xml.XmlTextWriter(sw) xtW.WriteStartElement("SDPCIP30") xtW.WriteStartElement("TSHeader") xtw.WriteElementString("SerNbr", _ TrimNumber(m_d.SerialNbr).PadLeft(10, "0"c)) xtW.WriteEndElement() xtW.WriteEndElement() xtW.Close() Dim sXml as String = sb.Tostring http://www.VBResizer.com Forms/Controls Resizing/Tabbing http://www.VBCompare.com Compare Code http://www.VBSortGen.com Generate Sort Class in VB http://www.Vbcompare.com/Check.Htm(1979 Check To MS)
Aug 18, 2004 #5 chiph Programmer Jun 9, 1999 9,878 US Another vote for the XmlTextWriter. It will handle the entity conversions for you. Same for using an XmlTextReader when reading an XML file -- it will convert the entity back to it's equivalent character. Chip H. ____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first Upvote 0 Downvote
Another vote for the XmlTextWriter. It will handle the entity conversions for you. Same for using an XmlTextReader when reading an XML file -- it will convert the entity back to it's equivalent character. Chip H. ____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first