Menu

#81 Allow ITS associations to match any uri

Rainbow
open
nobody
5
2008-03-18
2008-03-18
Anonymous
No

If you enter a blank URI in the ITS association list then this entry gets ignore. Basically I want a last resort catch anything ITS rule file to applied.

You can do this by making the following code change. Basically I've added a rule that treats blank URI's as the lowest level confidence match. The weights for all of the other entries have been increased by 1. The rest of the code stays the same.

public ArrayList GuessITSFile (string p_sURI,
string p_sDTD,
string p_sRoot)
{
foreach ( XLPListItem LI in m_aItems )
{
LI.Confidence = 0;
if ( p_sURI == LI.URI )
{
LI.Confidence += 3;
}
if ( p_sDTD == LI.DTD )
{
LI.Confidence += 3;
}
if ( p_sRoot == LI.Root )
{
LI.Confidence += 2;
}
// EDW - no URI should match
// every schema but with the lowest confidence.
if (LI.URI == String.Empty)
{
LI.Confidence += 1;
}
}

// Now build the return array and get the surest guess
ArrayList aRes = new ArrayList();
for ( int nConf=5; nConf>0; nConf-- )
{
foreach ( XLPListItem LI in m_aItems )
{
if ( LI.Confidence == nConf )
{
// Output: 'N=Path'
// Where N is the confidence (between 5 and 1)
aRes.Add(nConf.ToString()+"="+LI.Path);
}
}
}

return aRes;
}

Discussion

  • Nobody/Anonymous

    Logged In: NO

    please associated this issue with user - edwwsw.

     
  • Nobody/Anonymous

    Logged In: NO

    please associated this issue with user - edwwsw.