Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Loading XML

From: "Joe Fawcett" <joefawcett@---------.------>
To: 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.
>>
>> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent