Click here to Skip to main content
       

XML / XSL

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
QuestionHOW TO ANSWER A QUESTIONadminChris Maunder16 Jul '09 - 3:10 
Apologies for the shouting but this is important.
 
When answering a question please:
  1. Read the question carefully
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
  3. If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
  4. If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
 
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

QuestionHow to get an answer to your questionadminChris Maunder16 Jul '09 - 3:06 
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
     
  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
     
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
     
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
     
  5. Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
     
  6. Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
     
  7. If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
     
  8. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
     
  9. Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
     
  10. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
     
  11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
     
  12. No advertising or soliciting.
     
  13. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

QuestionParsing HTMLmemberPIEBALDconsult18 Apr '13 - 5:15 
OK, I'd be first to post a link to Parsing Html The Cthulhu Way
[^] if anyone suggests Regular Expressions, but I have a problem using an XmlDocument (and therefore XPath) with an HTML file I'm downloading.
 
The page is a list of files to download -- I need to extract the hrefs from the as, obviously I'd prefer to use XPath to do that.
 
0) The file doesn't contain an opening <HTML> tag (it does have a closing </HTML> tag D'Oh! | :doh: ) -- I can tack one on, that's not a big deal.
1) It contains at least one   entity (and possibly other entities) and the XmlDocument doesn't like that. Mad | :mad:
 
So I need options, people!
 
I can summon Cthulhu. Dead | X|
I can use Regular Expressions to replace any offending entities and then feed the result to an XmlDocument.
 
What other options might there be?
AnswerRe: Parsing HTMLprofessionalRichard Deeming18 Apr '13 - 5:56 
HTML != XML
 
Use the HTML Agility Pack[^] instead.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Parsing HTMLmemberPIEBALDconsult18 Apr '13 - 16:18 
Ah, sooooo... let the summoning begin!
 

Oh, mighty Cthulhu! Wise and terrible! I ask your assistance as my days have been blighted with some gnarly HTML! Please, oh lord, come smite the bare buttocks of the wretch who hast wrought this travesty. I will repay you with a pint of bitter. Not a measly USian pint mind you, but a proper Britsh pint.
GeneralRe: Parsing HTMLprofessionalRichard Deeming19 Apr '13 - 1:46 
No need to make that call to R'lyeh yet; the HAP makes parsing an HTML document simple:
HtmlDocument doc = new HtmlDocument();
doc.Load(@"path\to\your\file.htm");
 
foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
{
   string url = link["href"].Value;
   Fhtagn(url);
}



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionXML data representationmemberCsTreval5 Apr '13 - 0:39 
If I take data (1,2,3,a,b,c,..) and I put it in XML form
(<a>, < b >, <c>)
does that mean that data becomes information because of XML? Does XML turn data into information by representing it in tags?
 
I am also reading here in a slideshow: "In JDOM, every XML tree is approached as a document even though the content has nothing to do with documents". I looked up the definition of 'document' on dictionary.com and it states that a document is meant as being informative. 'informative' means 'to convey information'. Then, if the purpose of XML is to represent data into information, why does the content of an XML tree supposedly not have anything to do with a document and therefore nothing to do with information? This is confusing. Perhaps the author of that slideshow was using different semantics than I have in my mind right now.
 
Any thoughts on this?
AnswerRe: XML data representationprofessionalKenneth Haugland5 Apr '13 - 2:13 
I actually view XML documents as a datatable, and in fact you can store a datatable to XML format by the ToXML command.
QuestionHow to retrieve data from XLS/TXT file and DB?memberDavid venewald27 Feb '13 - 16:09 
Usually we meet various files like XLS,txt and others when preparing for a report, are their any easy ways or tools to make the format conversion more directly and easily?
GeneralRe: Dataset.GetXml() problemmemberchfu72224 Mar '13 - 21:48 
i also have the same problem

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 19 Apr 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid