diff --git a/Common/DaisyConverterLib/Parameters/DocumentParameters.cs b/Common/DaisyConverterLib/Parameters/DocumentParameters.cs index cddb04d..332f2d7 100644 --- a/Common/DaisyConverterLib/Parameters/DocumentParameters.cs +++ b/Common/DaisyConverterLib/Parameters/DocumentParameters.cs @@ -66,6 +66,7 @@ public DocumentParameters(string inputPath) "\u31A0-\u31BF" + "\u31F0-\u31FF" + "\u4DC0-\u4DFF" + + "\u4E00-\u9FFF" + "\uA000-\uA48F" + "\uA490-\uA4CF" + "\uAC00-\uD7AF" + @@ -259,7 +260,7 @@ public void updatePropertiesFromCopy() // for each paragraph in document XmlNodeList paragraph = wordContentDocument.SelectNodes( - "//w:body/w:p", + "//w:p", nsManager ); foreach ( XmlNode paragraphNode in paragraph ) { @@ -338,7 +339,8 @@ public void updatePropertiesFromCopy() // XmlNodeList runStyleId = run.SelectNodes("./w:rPr/w:rStyle/@w:val", nsManager); if (runStyleId.Count > 0) { - string styleVal = styleId[0].Value; + XmlAttribute xmlNode = (XmlAttribute)runStyleId[0]; + string styleVal = xmlNode.Value; XmlNodeList styleLanguages = stylesDocument.SelectNodes( $"//w:styles/w:style[@w:type='character' and @w:styleId='{styleVal}']/w:rPr/w:lang", nsManager @@ -380,9 +382,9 @@ public void updatePropertiesFromCopy() int langId = Languages.IndexOf(langToAdd); if (langId == -1) { Languages.Add(langToAdd); - languagesCount.Add(1); + languagesCount.Add(runText.Length); } else { - languagesCount[langId] += 1; + languagesCount[langId] += runText.Length; } } diff --git a/Common/DaisyConverterLib/resources/xslts/Common.xsl b/Common/DaisyConverterLib/resources/xslts/Common.xsl index c74be00..f58629f 100644 --- a/Common/DaisyConverterLib/resources/xslts/Common.xsl +++ b/Common/DaisyConverterLib/resources/xslts/Common.xsl @@ -2217,12 +2217,13 @@ + - + xml:lang="" @@ -2353,14 +2354,20 @@ - debug in List - + + + + + + 1 + + - + @@ -2766,7 +2773,14 @@ - + @@ -2779,14 +2793,19 @@ - + or (( + (w:pPr/w:pStyle/@w:val='Table-CaptionDAISY') + or (w:pPr/w:pStyle/@w:val='Caption') + or (./node()[name()='w:fldSimple']) + ) and ( + (preceding-sibling::node()[1][name()='w:tbl']) + or (following-sibling::node()[1][name()='w:tbl']) + )) + )"> @@ -3739,17 +3758,27 @@ - + or ( + (w:pPr/w:pStyle[@w:val='Image-CaptionDAISY']) + and ( + (following-sibling::node()[1]/w:r/w:drawing) + or (following-sibling::node()[1]/w:r/w:pict) + ) + ) + )"> diff --git a/Common/DaisyConverterLib/resources/xslts/Common3.xsl b/Common/DaisyConverterLib/resources/xslts/Common3.xsl index b3f89bf..137f301 100644 --- a/Common/DaisyConverterLib/resources/xslts/Common3.xsl +++ b/Common/DaisyConverterLib/resources/xslts/Common3.xsl @@ -21,21 +21,21 @@ - + + + + @@ -74,6 +77,9 @@ + + + @@ -84,6 +90,9 @@ + + + @@ -2141,19 +2150,21 @@ - - + + + + - + - + @@ -2181,8 +2192,21 @@ + + + + + + + + + + + + + + - @@ -2210,7 +2234,7 @@ - + @@ -2308,11 +2332,13 @@ + or $runNode/w:rPr/w:eastAsianLayout + or ($runNode/w:rPr/w:rFonts/@w:hint='eastAsia')"> + or $runNode/w:rPr/w:cs + or ($runNode/w:rPr/w:rFonts/@w:hint='cs')"> @@ -2333,11 +2359,11 @@ --> - + - +