From 33f04d19f61c40e3be37a29cddaba9edcfcb733a Mon Sep 17 00:00:00 2001 From: Fernando Chorney Date: Tue, 17 Sep 2019 16:17:04 -0500 Subject: [PATCH] numFmts element must be the first child --- src/styles.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/styles.jl b/src/styles.jl index 814cc25..f925f44 100644 --- a/src/styles.jl +++ b/src/styles.jl @@ -94,7 +94,12 @@ function styles_add_numFmt(wb::Workbook, format_code::AbstractString) :: Integer numfmts = findall("/xpath:styleSheet/xpath:numFmts", xroot, SPREADSHEET_NAMESPACE_XPATH_ARG) if isempty(numfmts) stylesheet = findfirst("/xpath:styleSheet", xroot, SPREADSHEET_NAMESPACE_XPATH_ARG) + + # We need to add the numFmts node directly after the styleSheet node + child = EzXML.firstelement(stylesheet) numfmts = EzXML.addelement!(stylesheet, "numFmts") + EzXML.unlink!(numfmts) + EzXML.linkprev!(child, numfmts) else numfmts = numfmts[1] end