Hi
I am attempting to inport XML into a XFA form using the Aspose.Pdf.Facades.Form.ImportXml method but it seems that attributes on repeating elements are not imported?
My XML looks like;
<?xml version="1.0" encoding="utf-8"?> <xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"> <formData> <codeData> <OccupationCode> <code> <id>77</id> <description>Agriculture</description> <dependentCodeSet codeSetName="ElibigleCertificateIIICode"> <id>1</id> <id>17</id> </dependentCodeSet> <dependentCodeSet codeSetName="CertificateCode"> <id>7</id> <id>8</id> <id>10</id> </dependentCodeSet> </code> </OccupationCode> </codeData> </formData> </xfa:data>
and the XML as seen by the XFA form looks like;
<xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"> <formData> <codeData> <OccupationCode> <code> <id>77</id> <description>Agriculture</description> <dependentCodeSet codeSetName="ElibigleCertificateIIICode"> <id>1</id> <id>17</id> </dependentCodeSet> <dependentCodeSet> <id>7</id> <id>8</id> <id>10</id> </dependentCodeSet> </code> </OccupationCode> </codeData> </formData> </xfa:data>
That is the attribute codeSetName="CertificateCode" on the second dependentCodeSet element has not been imported?
My C# code for this is taken from the samples.
Form form = new Form("ASPOSE.local.pdf", @"ASPOSE.updated.pdf"); System.IO.FileStream xmlInputStream = new FileStream(@"ASPOSE.xml", FileMode.Open); form.ImportXml(xmlInputStream); xmlInputStream.Close(); form.Save(); form.Close();
I have attached my test solution which demonstrates my problem, run this program and look at ASPOSE.updated.pdf in the bin directory. All this XFA form does is display the default dataset in a textbox, using the $data.saveXML("pretty"); statement in the calculate event.
This is my first attempt at working with Aspose.PDF so I am not at all confident with the product but it does seem strange that I get most of the XML imported.
Thanks
Bruce