Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Working with XML Files in Composite

$
0
0
Hi and welcome!

If you prefer to use XSLT you would

1) Upload your XML file to a directory (putting them below App_Data could make sense as this will prevent direct download)
2) Create an XSLT Function (see http://docs.composite.net/Functions/XSLT )
3) On the function, "Function Calls" tab, click Add new button and select the Composite.Xml.LoadFile function - as "Relative Path" specify path to the xml file you uploaded (for example "App_Data/Composite/Configuration/Composite.Media.ImageCrop.xml" which is an existing file that should work as demo).
4) Click Preview tab to see the input document for your XSLT - the file content will be loaded below "/in:inputs/in:result[@name='LoadFile']/"
5) Add more function calls if you need more XML sources
6) Write wonderful XSLT on the Template tab

You could also consider creating C1 Data Types that match the data schema of your XML (provided your XML is in a pretty flat structure) and then pull in data from the XML files. This enable you to work with your data "in a native nice way" from things like XSLT, and C# (Razor, MVC etc)
Export? My company may use Drupal in the future, is there a way to export from Composite C1 to an XML file or something?
You can find all data in nicely organized XML files in ~/App_Data/Composite/DataStores (unless you migrated data to SQL Server)

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>