Wrox Programmer Forums
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2009, 09:44 PM
Authorized User
 
Join Date: Jan 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default Parse and Format XML

I am able to read in the following xml document into my website with the following code:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<content>
  <paragraph1>
    This is the content for paragraph one.
 <li>List Item 1</li>
 <li>List Item 2</li>
 <li>List Item 3</li>
  </paragraph1>
  <paragraph2>
    This is the content for paragraph 2.
  </paragraph2>
</content>
Code:
        
        Dim doc As New System.Xml.XmlDocument()
        doc.Load(Server.MapPath("App_Data/content.xml"))
        p1.InnerText = doc.InnerText

But it reads it in as one paragraph. How can I read the xml file in and format it based on its nodes? Everything that I have tried throws an object undeclared error.
 
Old May 4th, 2009, 05:55 AM
Corin Louis
Guest
 
Posts: n/a
Default

Hi,
The parse-xmlgeneric function processes XML input, returning a list of XML tags, attributes, and text. The :pxml module is loaded with the form (require :pxml). Symbols naming functionality in the module are in the net.xml.parser package. Examples in this document assume (use-package :net.xml.parser) has been evaluated.
Here is a simple example:

(parse-xml "<item1><item2 att1='one'/>this is some text</item1>")

-->((item1 ((item2 att1 "one")) "this is some text")) The output format is known as LXML (Lisp XML) format.
 
Old May 4th, 2009, 05:57 AM
Corin Louis
Guest
 
Posts: n/a
Default

Hi,
The parse-xmlgeneric function processes XML input, returning a list of XML tags, attributes, and text. The :pxml module is loaded with the form (require :pxml). Symbols naming functionality in the module are in the net.xml.parser package. Examples in this document assume (use-package :net.xml.parser) has been evaluated.
Here is a simple example:

(parse-xml "<item1><item2 att1='one'/>this is some text</item1>")

-->((item1 ((item2 att1 "one")) "this is some text")) The output format is known as LXML (Lisp XML) format.

web developers atlanta





Similar Threads
Thread Thread Starter Forum Replies Last Post
parse xml data everest SQL Server 2005 0 March 6th, 2008 02:40 AM
Parse XML in ASP delaneyp Classic ASP XML 1 February 6th, 2006 08:42 AM
Parse XML response atulb XML 1 October 30th, 2005 07:05 AM
about XML receive by tomcatand XML parse by java taianmhzy Servlets 0 May 20th, 2004 01:59 AM
about XML receive ang XML parse by tomcat taianmhzy Apache Tomcat 0 May 20th, 2004 01:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.