Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Loading XML [Thread Next] Re: Loading XMLTo: NULL Date: 2/26/2009 9:15:00 AM Okay, I tried the script below (saved as LoadDocument.js and called at the
command prompt with: CScript LoadDocument.js Findings.xml) after saving the
document and it worked fine.
It maybe that the file isn't UTF-8, obviously I can't test that.
var _oDom = null
function getSyncDom()
{
if (!_oDom)
{
_oDom = new ActiveXObject("Msxml2.DomDocument.6.0");
_oDom.async = false;
}
return _oDom.cloneNode(false);
}
function showParseError(error)
{
var sMessage = "Error loading document:\n\tReason: " + error.reason;
sMessage += "\n\tSource: " + error.srcText;
sMessage += "\n\tLine: " + error.line;
WScript.echo(sMessage);
}
function main()
{
sScriptPath = WScript.ScriptFullName;
sScriptPath = sScriptPath.substr(0, sScriptPath.lastIndexOf("\\") + 1);
var sFileToValidate = WScript.Arguments(0);
var iValidationIndex = 1;
var oDoc = getSyncDom();
oDoc.validateOnParse = false;
oDoc.setProperty("ProhibitDTD", false);
//oDoc.resolveExternals = true;
var bLoaded = oDoc.load(sFileToValidate);
if (bLoaded)
{
WScript.echo(oDoc.xml);
}
else
{
showParseError(oDoc.parseError);
}
}
main();
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
"JG" <jgeissman@s...> wrote in message
news:MPG.240faca59e945f9f98968d@n......
> Thanks, Joe, but please don't go to any trouble. The "solution" of
> removing the trouble-makers works fine. Here's what it looks like
> (abridged & redacted version):
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE CodifiedFindings SYSTEM "CFFVersion1.1.dtd">
> <CodifiedFindings>
> <ResponseHeader FileType="CFF" FileVersionIdentifier="1.1"
> InstitutionIdentifier="zzzzz" UserName="yyyyy"
> UnderwritingEngineName="7.1" UnderwritingResultsDateTime="20090224
> 19:19:19" UnderwritingSubmissionNumber="9999"/>
> <Casefile FNMCaseIdentifier="xxxxx" LenderCaseIdentifier="wwwww"/>
> <CasefileMessages>
> <Message MessageIdentifier="8" MessageSeverityTypeCode="1"
> MessageCategoryTypeCode="1">
> <LenderMessageText>
> <Line MessageText="The risk profile of this loan casefile
> appears to meet Fannie Mae's guidelines."/>
> </LenderMessageText>
> </Message>
> </CasefileMessages>
> <DocumentationLevelCodes RequiredDocumentationTypeCode="01"
> RequiredDocumentationLevelCode="101"/>
> </CodifiedFindings>
>
> Jim G
>
> In article <OgqKoZylJHA.1248@T...>,
> joefawcett@n... says...
>> Okay, if you post the document here I'll have a go loading it.
>>
>>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
