Advertisement

01.30.2007 at 12:04PM PST, ID: 22142596
[x]
Attachment Details

Help Needed To Design Class

Asked by dbnewbie in Microsoft Visual Basic.Net

I need help designing a class that I want to build. At the very basic level, I want to provide the user the capability to convert HTML to well-formed XML. I already have the code to do this; all I need to do know is put it together in a class. Here are some of the things I am considering putting in:

(pseudo VB.Net)

1. Property Document As String - gets or sets the document to convert to well formed XML

2. Method ToWellFormed As String - returns the well-formed version of Document

3. Method Load(uri As String) - sets Property Document with contents of file located at uri
   - OR Method Load(filename As String) - sets Property Document with the contents of file located at filename
   - OR Method Load(doc As String) - sets Property Document with the contents of doc (functionally the same as Property Document. If I do this, maybe I need to remove the Document Property.)
   - OR Sub New(uri As String) OR Sub New(filename As String) OR Sub New(doc As String)
   - OR never mind any of these since Property Document is already provided; let the user figure out how to set Document (but it might be nice to make the user's life easier by providing some sort of Load method)

4. Method ToPrettyPrint - returns results of ToWellFormed in pretty print

5. Method GetContents (includeAttributes as Boolean) - returns the concatenated values of nodes of ToWellFormed (similar to XmlNode.InnerXml except that a space is included between values); if includeAttributes = True, then Attribute Nodes are included in the concatenated values; otherwise, no
   - OR maybe the argument should allow for a third option, e.g. "Smart." Smart will return the concatenated values of relevant attribute and element values (e.g. alt attribute is relevant, id attribute is not; title element is relevant, br is not, etc.). Relevant could be predetermined or configurable somehow (which means a configuration document must somehow be assigned to the class???)

6. Property IsWellFormed As Boolean - returns whether or not Document is well formed

Any suggestions how to organize this better? Please suggest better names if you can think of any. If you think I am putting in too much or too little features, please say so.

One more thing, I would like to offer this as a Web Service. Any suggestions or tips for that? Thanks.
Start Free Trial
[+][-]01.30.2007 at 12:07PM PST, ID: 18430720

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.30.2007 at 02:01PM PST, ID: 18431671

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.30.2007 at 02:45PM PST, ID: 18431987

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.30.2007 at 06:19PM PST, ID: 18432968

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.30.2007 at 11:09PM PST, ID: 18433988

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.31.2007 at 02:17PM PST, ID: 18440248

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.01.2007 at 12:33PM PST, ID: 18447409

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Sign Up Now!
Solution Provided By: kiphughes
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32