Tag: xml namespaces

Excel中的XML名称空间

我试图在Excel中使用OpenStreetMap旅行时间来构build距离matrix。 我使用YOURS API和Google Maps API excel模块作为参考( http://oco-carbon.com/2012/05/17/a-google-maps-journey-time-function-for-excel/ ) 。 这是我想要带入Excel的XML示例: http : //www.yournavigation.org/api/1.0/gosmore.php? format = xml&flat=60.480398&flon=22.277206& tlat= 60.402923& tlon= 22.355558& v=汽车及快= 1&层= Mapnik的 目前我的VB代码如下所示: Function G_TIME(Flat As String, Flon As String, Tlat As String, Tlon As String) As Double ' Requires a reference to Microsoft XML, v6.0 ' Draws on the stackoverflow answer at bit.ly/parseXML […]

试图通过XML在Excel中设置页边距

我已经“inheritance”了一些将数据下载到Excel电子表格的代码。 格式化html的相同表格生成excel数据。 我正在尝试为工作表设置页边距。 下面的代码并没有真的做到这一点。 我认为XML数据被忽略。 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:x="urn:schemas-microsoft-com:office:excel"> <head id="Head1" runat="server"> <title></title> <style> @page { mso-page-orientation:portrait; } </style> <xml> <x:ExcelWorkbook> <x:ExcelWorksheets> <x:ExcelWorksheet> <x:Name>HoursReport</x:Name> <x:WorksheetOptions> <x:Selected/> <x:FreezePanes/> <x:FrozenNoSplit/> <!— Bottom row number of top pane. —> <x:SplitHorizontal>4</x:SplitHorizontal> <x:TopRowBottomPane>4</x:TopRowBottomPane> <x:PageSetup> <x:Header x:Margin="0.25"/> <x:Footer x:Margin="0.25"/> <x:PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/> </x:PageSetup> […]

Excel 2007:XML:在缺lessss:namespace限定符时窒息

尝试使用C#和System.XML.Serialization创buildExcel 2007 XML文件。 Excel XML文件的根元素是这样的: <Workbook xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="urn:schemas-microsoft-com:office:spreadsheet"> 默认命名空间中的许多元素都具有用“ss”限定的属性,由于“ss”和默认命名空间都是“urn:schemas-microsoft-com:office:spreadsheet”,所以这是不必要的。 例如,Style元素显示为: <Style ss:ID="s21"> <Font x:Family="Swiss" ss:Bold="1"/> </Style> 当我创build我的XmlSerializerNamespaces时,我添加所需的所有命名空间,Excel需要: var ns = new XmlSerializerNamespaces(); ns.Add("", "urn:schemas-microsoft-com:office:spreadsheet"); ns.Add("o", "urn:schemas-microsoft-com:office:office"); ns.Add("x", "urn:schemas-microsoft-com:office:excel"); ns.Add("ss", "urn:schemas-microsoft-com:office:spreadsheet"); ns.Add("html", "http://www.w3.org/TR/REC-html40"); 在生成的XML中,“”(默认)名称空间被省略,因为它与“ss”相同。 我的样式对象是沿着以下几行:[XmlRoot(Namespace =“urn:schemas-microsoft-com:office:spreadsheet”)] public class Styles {[XmlAttribute] public string ID {get; 组; } [XmlAttribute] public string Name { get; set; } […]