Jan 7, 2002 #1 111333 Programmer Feb 3, 2005 4 IN I have 2 files, ASP and XML. I would like to put HTML tags like <b> Bold </b> in the XML file and have the output show in ASP page. How can I do so in XML file ?
I have 2 files, ASP and XML. I would like to put HTML tags like <b> Bold </b> in the XML file and have the output show in ASP page. How can I do so in XML file ?
Jan 14, 2002 #2 sjuarez1979 Programmer Jun 26, 2001 35 US You can just have a node in the XML as follows: <ROOT> <TextOut> <b>text to be bolded</b> </TextOut> </ROOT> The ASP Code would be as follows: Dim objDom Dim objRoot Dim objField Dim strFile strFile = PathToFile 'XML file object Set objDom = Server.CreateObject("Microsoft.XMLDOM" objDom.async = False strXMLFile = Server.MapPath(strFile) objDom.Load (strXMLFile) 'Root XML Field Set objRoot = objDom.documentElement 'collect information from nodes Set objField = objRoot.selectSingleNode("TextOut" 'This outputs ALL of the content in the TextOut node Response.Write(objField.Text) 'Release variables Set objDom = Nothing Set objRoot = Nothing Set objField = Nothing Pretty smart stuff, this code works: I've tested it. May the force be with you, sjuarez1979 Upvote 0 Downvote
You can just have a node in the XML as follows: <ROOT> <TextOut> <b>text to be bolded</b> </TextOut> </ROOT> The ASP Code would be as follows: Dim objDom Dim objRoot Dim objField Dim strFile strFile = PathToFile 'XML file object Set objDom = Server.CreateObject("Microsoft.XMLDOM" objDom.async = False strXMLFile = Server.MapPath(strFile) objDom.Load (strXMLFile) 'Root XML Field Set objRoot = objDom.documentElement 'collect information from nodes Set objField = objRoot.selectSingleNode("TextOut" 'This outputs ALL of the content in the TextOut node Response.Write(objField.Text) 'Release variables Set objDom = Nothing Set objRoot = Nothing Set objField = Nothing Pretty smart stuff, this code works: I've tested it. May the force be with you, sjuarez1979