C14nTo |
public static int ToFile( string outFile, string xmlFile, string nameOrId = "", Tran tranOpt = Tran.Entire, TranMethod tranMethod = TranMethod.Inclusive, string exclParams = "", AdvOptions advOpts = AdvOptions.Default )
With options OmitByTag or SubsetByTag, nameOrId specifies the element's tag name.
Exactly one element will be omitted or included. Tag names and Id values are case sensitive. It is an error (NO_DATA_ERROR) if no matching element is found.
// Example 1. Omits the first element with the tag name <Signature> r = C14n.ToFile("c14nfile1.txt", "input.xml", "Signature", Tran.OmitByTag); // Example 2. Finds and transforms the first element with the tag name <SignedInfo> r = C14n.ToFile("c14nfile2.txt", "input.xml", "SignedInfo", Tran.SubsetByTag); // Example 3. Finds and transforms the third element with the tag name <Data> r = C14n.ToFile("c14nfile3.txt", "input.xml", "Data[3]", Tran.SubsetByTag); // Example 4. Finds and transforms the element with attribute Id="foo" r = C14n.ToFile("c14nfile4.txt", "input.xml", "foo", Tran.SubsetById); // Example 5. Finds and transforms the element with attribute ID="bar" r = C14n.ToFile("c14nfile5.txt", "input.xml", "ID=bar", Tran.SubsetById); // Example 6. Omits element with attribute Id="thesig" r = C14n.ToFile("c14nfile6.txt", "input.xml", "thesig", Tran.OmitById);