Working With XML FilesLet's say you have an XML file - we'll call it foo.xml in keeping with geek tradition - and it uses an XSL file named foo.xsl that takes care of making it look pretty. This article will assume you have that much up and running. You have two options for bringing that into CityDesk. Drag and Drop Raw .xml Files in CityDesk You can drag foo.xml into CD (CityDesk), have it point to its style sheet friend foo.xsl also in CD (or linked externally), and when foo.xml is viewed in a browser the styles will be applied and all will be good (it will be displayed prettily). How will your users get to your file? In CityDesk 2.0 {$ include "foo.xml" $} is not supported. The "include" directive can only be used with CD "articles", since articles are not raw files but are actually CD objects with properties and all that good stuff. So, you cannot dynamically import the contents of foo.xml into an article or template using "include". So to view raw .xml files, just give your users links to those files, e.g. put a link to foo.xml in an article. Importing XML Content into Articles and Templates To move beyond the above limitations and start taking advantage of the powerful tools CityDesk provides, you need to import your XML into articles and templates. For example, once you move the XML into an article, you can use {$ include $} to include one XML file inside another. 1. First, you'll need a template for use with your XML files. Click Templates, then New Template; give it a name, let's say "XML Files" for now, and type in .xml for the extension. That file extension is the bare necessity, do whatever else you like with the "Prompts" options, a.k.a. article properties. Click OK to save the new Template, then Done to leave the Templates editor. 2. Add a new article, called foo (not called "foo.xml", the template will add the extension). Open foo and make sure you're in HTML View not Normal View. Paste in the entire contents of your foo.xml file. Switch to the Properties tab, and select your new XML template ("XML Files") for this article. Save the file and preview it. You have now imported the XML file into an article. You now have all the power CityDesk offers to work with that article, such as keywords, timestamps, variables, includes, etc., and the XML template itself. WARNING! There is a huge caveat here. XML is not supported by the WYSIWYG HTML editor in CityDesk. This means that if you view your XML article in "Normal View" (which is the WYSIWYG mode), your XML tags will be stripped out. If you always view your XML article in "HTML View" (the source code mode) you will be fine. If you end up in Normal View without meaning to, just close without saving your changes. Batch Conversions If you have too many XML files for this manual import approach to be feasible, you may be interested in a shareware program called CopyBoy, which will convert multiple files into CD articles at once. It is available on this website. |

