1

Trying to write the XML to go to a file path that not only has spaces it has an & in the title. I have asked to change this folder path but unfortunately, this is not doable.. apparently.

I need to be able to write the path with the & in it. Is there a way to do this?

The XML template is in this link :<//knowledge.autodesk.com/support/revit-products/learn-explore/caas/simplecontent/content/model-checker-automation.html>

the file path is this : P:\19-100 Road & Drive\BIM\01 Live\BIM Models\modelfile.rvt

<?xml version="1.0" encoding="utf-8" ?>
 <AutomatedRun Cleanup="delete">

  </Model>

   <Model Path="P:\19-100  Road & Drive\BIM\01 Live\BIM Models\file.rvt">

   <CheckSet Path="N:\00-102 KHUB Practice Systems\00 400 BIM\12-PowerBi\01 Revit Checksets\Revit 2021 Model Dashboard.xml" ExportHtml="False" ExportExcel="true" HtmlFolder="C:\Some\Folder" ExcelPath="N:\00-102 KHUB Practice Systems\00 400 BIM\12-PowerBi\02 Projects\19-100_Road and Drive\01 Data\drive\internal\AUTO.xlsx" CheckLinks="False" />       

  </Model>

 </AutomatedRun>

There is also a log file that describes the error 30/07/2021 16:06 - Checking for automated runs 30/07/2021 16:06 - Getting run data from folder: C:\ProgramData\Autodesk\BIT\Model Checker\2021\Automated Runs 30/07/2021 16:06 - Parsing file: C:\ProgramData\Autodesk\BIT\Model Checker\2021\Automated Runs\2021_19-100_HTC-AVD.xml 30/07/2021 16:06 - Error parsing file: System.Xml.XmlException: ' ' is an unexpected token. The expected token is ';'. Line 5, position 42.

1 Answers1

1

& in XML content is written as &amp;.

This will work fine so long as the XML is being read by a true XML parser and not by some lash-up code that doesn't do the unescaping properly.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • i tried this but the error while parsing(?) threw up an error. – Amy Beckenham Jul 30 '21 at 15:09
  • Then we need to diagnose the error that it threw up, because you're now writing correct XML. – Michael Kay Jul 30 '21 at 16:40
  • I realise that, that is why i am here. The file path i cannot change. I believe that this cannot be done. But thought i would ask on here to see if anyone else had any ideas. I will try to post the code – Amy Beckenham Aug 02 '21 at 09:18
  • Well, if you want help on this error, start by telling us what the error is. – Michael Kay Aug 02 '21 at 13:15
  • I honestly don't know what more I can add Michael. – Amy Beckenham Aug 20 '21 at 08:05
  • You said "I tried this". By that I assumed you meant that you changed `&` to `&` as suggested. But if you're still getting the same error, then you didn't make this change successfully. If you're getting a different error, then you need to tell us what the new error is. – Michael Kay Aug 20 '21 at 08:43
  • I got the same error as above. The log reads that the file path doesn't exist and that it won't run. Whether the XML says & or &amp, the error message is the same. I have added it above – Amy Beckenham Aug 21 '21 at 15:12