|
|
 |
| 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 tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

April 26th, 2009, 09:44 PM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

May 4th, 2009, 05:55 AM
|
|
Banned
|
|
Join Date: Apr 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

May 4th, 2009, 05:57 AM
|
|
Banned
|
|
Join Date: Apr 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |