Add multiple elements from a xlm via xslt file

Sorry to be so dense, but I can not get ASPOSE.net using and xml and xslt file to step through multiple objects in the xml file. I have taken your hello world cample and tried to make it show it twice just but adding another element in the xml file.

I have tried 2 ways using the xslt file so there are 2 xslt fiels in the attached zip A and B.

Can you point me in the correct direction?


This message was posted using Page2Forum (attachment) from Create a Hello World PDF document through XML and XSLT - Aspose.Pdf for .NET

Hello David,

Thanks for considering Aspose.

In order to display two segments of text, first specify two uniquely identified content elements in XML and then use xsl:value-of select tag for each segment to use content value in it. Please try using the attached XML and XSLT files. In case it does not satisfy your requirement or you've any further query, please feel free to contact.

So maybe I am missing somthing but in a "normal" xml file that has a list of somthing say names and you wanted to put that as a pdf without changing the XML you can't?

See example.xml

Hello David,

Thanks for considering Aspose.

In order to convert an XML file into PDF format, the XML file must be in Aspose.Pdf compatible format. To be more specific, the XML file must follow the rules of DOM (Document Object Model) of Aspose.Pdf.

According to DOM of Aspose.Pdf, a PDF document is comprised of one or more sections, whereas a section can have one or more paragraphs. A paragraph can be an Image file, a text paragraph, a Graph object, FloatingBox, Table, an Attachment, Form Field or a Heading object.

The information present in your XML file does not follow the rules of Aspose.Pdf DOM. So in order to transform your XML file into PDF format, you need to use XSLT, because it is a formatting language that is used to set the formatting styles of XML data. In your earlier post, you had a custom XML file and you were using XSLT to define the XML data according to DOM of Aspose.Pdf.

Please visit the following link for more information on Aspose.Pdf for .NET Document Object Model (DOM)

You can also visit this link for Introduction to XSL

In case of any further query, please feel free to contact.