---
title: "Fel XML formattering?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/183978-fel-xml-formattering"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "asp"
published: "2010-06-30T14:35:24.000Z"
updated: "2010-06-30T14:35:24.000Z"
replies: 0
views: 943
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/183978-fel-xml-formattering"
---

# Fel XML formattering?

## #1 — asp, 2010-06-30T14:35Z

Hej,

När jag försöker hämta XML-dokumentet (<http://pricefeeds.williamhill.com/oxipubserver?template=getEventsByClass&class=|UK%20Football|>) får jag följande felmeddelande:

**An invalid character was found in text content.**

Koden jag använder för att hämta xml-dokumentet ser ut såhär:

```
function getXml(xmlPath)
    dim xmlDoc
    dim isValid

    set xmlDoc = server.createObject("Microsoft.XMLDOM")
    xmlDoc.async = false
	xmlDoc.setProperty "ServerHTTPRequest", true
    xmlDoc.load (xmlPath)
    isValid = cBool(xmlDoc.parseError.errorCode = 0)
    if not isValid then
        response.write getXMLError(xmlDoc)
    end if

    set getXml = xmlDoc
end function

function getXMLError(xmlDoc)
    dim strError
    strError = "Invalid XML file!" & vbNewline & _
        "File: " & xmlDoc.parseError.url & vbNewline & _
        "Line: " & xmlDoc.parseError.line & vbNewline & _
        "Character: " & xmlDoc.parseError.linepos & vbNewline & _
        "Source Text: " & xmlDoc.parseError.srcText & vbNewline & _
        "Description: " & xmlDoc.parseError.reason
    getXMLError = strError
end function
```

Tacksam för hjälp!

Permalänk: https://www.webforum.nu/p/183978

---

Tråden på webben: https://www.webforum.nu/amne/asp/183978-fel-xml-formattering
