From 2327e9c224ba6d139992d8d496bd1244b9c79b11 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Tue, 9 Apr 2019 00:06:47 -0400 Subject: [PATCH 1/8] Handle custom attributes --- .../stylesheets/eZXml2Docbook_core.xsl | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl b/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl index e77b62bf..d05f103e 100644 --- a/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl +++ b/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl @@ -149,6 +149,18 @@ + + + + + + + + + + + + @@ -161,6 +173,7 @@ + @@ -196,6 +209,7 @@ + @@ -208,6 +222,7 @@ + @@ -278,6 +293,7 @@ + @@ -367,6 +383,7 @@ + @@ -378,6 +395,7 @@ + @@ -389,6 +407,7 @@ + @@ -400,6 +419,7 @@ + @@ -451,6 +471,7 @@ + @@ -471,6 +492,7 @@ + @@ -517,6 +539,7 @@ + @@ -553,6 +576,7 @@ + From a981d4e5f0141020beb84cc76ae9807e5155d888 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Wed, 17 Apr 2019 13:27:16 -0400 Subject: [PATCH 2/8] Custom attributes: use new naming convensions --- .../XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl b/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl index d05f103e..7182d89a 100644 --- a/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl +++ b/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl @@ -151,7 +151,7 @@ - + From 1fcc97c9597b586ce832ab029b06e1034948634f Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Wed, 17 Apr 2019 15:09:21 -0400 Subject: [PATCH 3/8] Custom attributes: handle literal, quote, underline, strike, sub, sup --- .../Input/Resources/stylesheets/eZXml2Docbook_core.xsl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl b/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl index 7182d89a..761fc44c 100644 --- a/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl +++ b/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl @@ -115,6 +115,7 @@ + <![CDATA[ ]]> @@ -198,6 +199,7 @@ + @@ -232,22 +234,26 @@ underlined + strikedthrough + + + From d810f1ed20b38f68e114444f18c4db4e84ab6bbe Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Wed, 17 Apr 2019 15:09:52 -0400 Subject: [PATCH 4/8] Custom attributes: tests --- .../Xslt/_fixtures/docbook/002-para.xml | 1 + .../Xslt/_fixtures/docbook/005-emphasis.xml | 1 + .../_fixtures/docbook/006-emphasisStrong.xml | 1 + .../docbook/007-emphasisUnderlined.xml | 1 + .../_fixtures/docbook/008-orderedList.xml | 13 ++++ .../_fixtures/docbook/009-itemizedList.xml | 13 ++++ .../docbook/010-htmlInformaltable.xml | 32 ++++++++++ .../Xslt/_fixtures/docbook/011-htmlTable.xml | 32 ++++++++++ .../Xslt/_fixtures/docbook/014-link.xml | 3 + .../Xslt/_fixtures/docbook/015-subscript.xml | 1 + .../_fixtures/docbook/016-superscript.xml | 1 + .../docbook/019-emphasisStrikedthrough.xml | 1 + .../Xslt/_fixtures/docbook/020-blockquote.xml | 7 +++ .../docbook/021-titleImplicitLevels.xml | 63 +++++-------------- .../Xslt/_fixtures/docbook/024-template.xml | 4 ++ .../Xslt/_fixtures/ezxml/002-para.xml | 1 + .../Xslt/_fixtures/ezxml/005-emphasis.xml | 1 + .../_fixtures/ezxml/006-emphasisStrong.xml | 1 + .../ezxml/007-emphasisUnderlined.xml | 1 + .../Xslt/_fixtures/ezxml/008-orderedList.xml | 7 +++ .../Xslt/_fixtures/ezxml/009-itemizedList.xml | 7 +++ .../_fixtures/ezxml/010-htmlInformaltable.xml | 14 ++--- .../Xslt/_fixtures/ezxml/011-htmlTable.xml | 14 ++--- .../Xslt/_fixtures/ezxml/014-link.xml | 3 + .../Xslt/_fixtures/ezxml/015-subscript.xml | 1 + .../Xslt/_fixtures/ezxml/016-superscript.xml | 1 + .../ezxml/019-emphasisStrikedthrough.xml | 1 + .../Xslt/_fixtures/ezxml/020-blockquote.xml | 5 ++ ....lossy.xml => 021-titleImplicitLevels.xml} | 49 +++++++++++++++ .../ezxml/lossy/002-htmlTable.docbook.xml | 20 ++++++ .../ezxml/lossy/004-tableTitles.docbook.xml | 6 ++ .../ezxml/lossy/108-expandTable.docbook.xml | 6 ++ .../richtext/output/083-header-nested.xml | 9 +++ .../_fixtures/richtext/output/090-table.xml | 4 ++ .../143-paragraph-temporary-table-oe.xml | 8 +++ ...aragraph-temporary-table-simplifiedxml.xml | 8 +++ .../_fixtures/richtext/output/150-literal.xml | 2 +- 37 files changed, 279 insertions(+), 64 deletions(-) rename tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/{021-titleImplicitLevels.lossy.xml => 021-titleImplicitLevels.xml} (59%) diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/002-para.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/002-para.xml index d717b1d5..dda924e3 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/002-para.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/002-para.xml @@ -10,4 +10,5 @@ This is a centered paragraph. This is a right aligned paragraph. This is a justified paragraph. + value 1value 2This is a paragraph with custom tags. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/005-emphasis.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/005-emphasis.xml index d891f32f..68722560 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/005-emphasis.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/005-emphasis.xml @@ -6,4 +6,5 @@ version="5.0-variant ezpublish-1.0"> This is a heading. This is a paragraph with emphasized text. + This is a paragraph with value 1value 2emphasized (custom attributes) text. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/006-emphasisStrong.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/006-emphasisStrong.xml index 771509f8..a6ae3c22 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/006-emphasisStrong.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/006-emphasisStrong.xml @@ -6,4 +6,5 @@ version="5.0-variant ezpublish-1.0"> This is a heading. This is a paragraph with strong text. + This is a paragraph with value 1value 2strong (custom attributes) text. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/007-emphasisUnderlined.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/007-emphasisUnderlined.xml index 4378b1fd..a7da8c8d 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/007-emphasisUnderlined.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/007-emphasisUnderlined.xml @@ -6,4 +6,5 @@ version="5.0-variant ezpublish-1.0"> This is a heading. This is a paragraph with underlined text. + This is a paragraph with value 1value 2underlined (custom attributes) text. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/008-orderedList.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/008-orderedList.xml index 8e9d8ae8..1dd0a7ef 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/008-orderedList.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/008-orderedList.xml @@ -7,4 +7,17 @@ This is a list item. + + + list 1 + list 2 + + + + list item 1 + list item 2 + + This is a list item (custom attributes). + + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/009-itemizedList.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/009-itemizedList.xml index 11559d6a..22ec413b 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/009-itemizedList.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/009-itemizedList.xml @@ -7,4 +7,17 @@ This is a list item. + + + list 1 + list 2 + + + + list item 1 + list item 2 + + This is a list item. + + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/010-htmlInformaltable.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/010-htmlInformaltable.xml index 01cd6f14..2a4633c0 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/010-htmlInformaltable.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/010-htmlInformaltable.xml @@ -5,24 +5,56 @@ xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> + + tableTitle + + value 1 + value 2 + + + value 1 + + + top + XSLT + col + value 1 + 11 + + middle + XSD + row + value 2 + 12.1 12.2 + + value 2 + + + bottom + value 1 + 21 This is a list item. + + baseline + value 2 + 22 This is a paragraph with some diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/011-htmlTable.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/011-htmlTable.xml index 3875abf8..c2686917 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/011-htmlTable.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/011-htmlTable.xml @@ -5,21 +5,53 @@ xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> + + tableTitle + Table caption. + value 1 + value 2 + + + value 1 + + + value 2 + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/014-link.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/014-link.xml index 9ce2897f..3df67905 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/014-link.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/014-link.xml @@ -21,4 +21,7 @@ Content nameSome anchored content. + + value 1value 2Link with custom attributes + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/015-subscript.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/015-subscript.xml index 679ce61d..3513cf47 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/015-subscript.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/015-subscript.xml @@ -5,4 +5,5 @@ xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> Thirsty? Have some H2O. + Thirsty? Have some Hvalue 1value 22 (custom attribute)O. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/016-superscript.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/016-superscript.xml index ca7709bb..496eab52 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/016-superscript.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/016-superscript.xml @@ -5,4 +5,5 @@ xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> The equation eπi + 1 = 0 ties together five of the most important mathematical constants. + The equation evalue 1value 2πi (custom attributes) + 1 = 0 ties together five of the most important mathematical constants. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/019-emphasisStrikedthrough.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/019-emphasisStrikedthrough.xml index c7665ea1..37272c5b 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/019-emphasisStrikedthrough.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/019-emphasisStrikedthrough.xml @@ -6,4 +6,5 @@ version="5.0-variant ezpublish-1.0"> This is a heading.This is a paragraph with strikedthrough text. + This is a paragraph with value 1value 2strikedthrough (custom attributes) text. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/020-blockquote.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/020-blockquote.xml index 7cb930d0..b6a756cc 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/020-blockquote.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/020-blockquote.xml @@ -13,4 +13,11 @@
Don't wake me for the end of the world unless it has very good special effects.
+
+ + value 1 + value 2 + + Don't wake me for the end of the world unless it has very good special effects. +
diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/021-titleImplicitLevels.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/021-titleImplicitLevels.xml index ffdc5924..39b14297 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/021-titleImplicitLevels.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/021-titleImplicitLevels.xml @@ -4,53 +4,18 @@ xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> - This is a first level heading. -
- This is a second level heading. -
-
-
- This is a third level heading. -
-
-
-
-
- This is a fourth level heading. -
-
-
-
-
-
-
- This is a fifth level heading. -
-
-
-
-
-
-
-
-
- This is a sixth level heading. -
-
-
-
-
-
-
-
-
-
-
- This is a seventh level heading. -
-
-
-
-
-
+ This is a first level heading. + This is a second level heading. + This is a third level heading. + This is a fourth level heading. + This is a fifth level heading. + This is a sixth level heading. + This is a seventh level heading. + <ezattribute><ezvalue key="title-level">1</ezvalue></ezattribute>This is a first level heading. + <ezattribute><ezvalue key="title-level">2</ezvalue></ezattribute>This is a second level heading. + <ezattribute><ezvalue key="title-level">3</ezvalue></ezattribute>This is a third level heading. + <ezattribute><ezvalue key="title-level">4</ezvalue></ezattribute>This is a fourth level heading. + <ezattribute><ezvalue key="title-level">5</ezvalue></ezattribute>This is a fifth level heading. + <ezattribute><ezvalue key="title-level">6</ezvalue></ezattribute>This is a sixth level heading. + <ezattribute><ezvalue key="title-level">7</ezvalue></ezattribute>This is a seventh level heading. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/024-template.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/024-template.xml index 421f529e..4f36bde6 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/024-template.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/024-template.xml @@ -7,6 +7,10 @@
Table caption.
+ + top + XSLT + col + value 1 + 11 + + middle + XSD + row + value 2 + 12
+ + bottom + value 1 + 21 + + baseline + value 2 + 22
+ + tableTitle + About factoids + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/002-para.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/002-para.xml index 206902b7..d74e4f29 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/002-para.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/002-para.xml @@ -10,4 +10,5 @@ This is a centered paragraph.This is a right aligned paragraph.This is a justified paragraph. + This is a paragraph with custom tags. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/005-emphasis.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/005-emphasis.xml index edc25aa7..ec2874b0 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/005-emphasis.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/005-emphasis.xml @@ -6,4 +6,5 @@
This is a heading.
This is a paragraph with emphasized text. + This is a paragraph with emphasized (custom attributes) text. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/006-emphasisStrong.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/006-emphasisStrong.xml index e592d260..b23ead3e 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/006-emphasisStrong.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/006-emphasisStrong.xml @@ -6,4 +6,5 @@
This is a heading.
This is a paragraph with strong text. + This is a paragraph with strong (custom attributes) text. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/007-emphasisUnderlined.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/007-emphasisUnderlined.xml index 520d241f..5a28d408 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/007-emphasisUnderlined.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/007-emphasisUnderlined.xml @@ -6,4 +6,5 @@
This is a heading.
This is a paragraph with underlined text. + This is a paragraph with underlined (custom attributes) text. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/008-orderedList.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/008-orderedList.xml index 4b191a21..09abcd54 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/008-orderedList.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/008-orderedList.xml @@ -9,4 +9,11 @@ + +
    +
  1. + This is a list item (custom attributes). +
  2. +
+
diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/009-itemizedList.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/009-itemizedList.xml index 958df716..026a6389 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/009-itemizedList.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/009-itemizedList.xml @@ -9,4 +9,11 @@ + +
    +
  • + This is a list item. +
  • +
+
diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/010-htmlInformaltable.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/010-htmlInformaltable.xml index bb816641..5f6f15c7 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/010-htmlInformaltable.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/010-htmlInformaltable.xml @@ -3,18 +3,18 @@ xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/"> -
About factoids
- -
+ + + - - - + -
11 + 12.1 12.2
+
21
    @@ -24,7 +24,7 @@
+ 22 This is a paragraph diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/011-htmlTable.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/011-htmlTable.xml index 631dbb3e..b2446d7f 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/011-htmlTable.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/011-htmlTable.xml @@ -3,20 +3,20 @@ xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/"> - - -
+ + + - - - + - diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/014-link.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/014-link.xml index 5d39db51..341dbd99 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/014-link.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/014-link.xml @@ -21,4 +21,7 @@ Content nameSome anchored content. + + Link with custom attributes + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/015-subscript.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/015-subscript.xml index 6bca5d53..568890d8 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/015-subscript.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/015-subscript.xml @@ -3,4 +3,5 @@ xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/"> Thirsty? Have some H2O. + Thirsty? Have some H2 (custom attribute)O. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/016-superscript.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/016-superscript.xml index d5a8badf..0aa03a34 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/016-superscript.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/016-superscript.xml @@ -3,4 +3,5 @@ xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/"> The equation eπi + 1 = 0 ties together five of the most important mathematical constants. + The equation eπi (custom attributes) + 1 = 0 ties together five of the most important mathematical constants. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/019-emphasisStrikedthrough.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/019-emphasisStrikedthrough.xml index 68d3ec5c..7832f60c 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/019-emphasisStrikedthrough.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/019-emphasisStrikedthrough.xml @@ -6,4 +6,5 @@
This is a heading.
This is a paragraph with strikedthrough text. + This is a paragraph with strikedthrough (custom attributes) text. diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/020-blockquote.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/020-blockquote.xml index 63bc042c..683031d6 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/020-blockquote.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/020-blockquote.xml @@ -15,4 +15,9 @@ Don't wake me for the end of the world unless it has very good special effects. + + + Don't wake me for the end of the world unless it has very good special effects. + + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/021-titleImplicitLevels.lossy.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/021-titleImplicitLevels.xml similarity index 59% rename from tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/021-titleImplicitLevels.lossy.xml rename to tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/021-titleImplicitLevels.xml index 0b30577a..22d0f42e 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/021-titleImplicitLevels.lossy.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/021-titleImplicitLevels.xml @@ -65,4 +65,53 @@ level attributes in docbook format. +
+
This is a first level heading.
+
+
+
This is a second level heading.
+
+
+
+
This is a third level heading.
+
+
+
+
+
+
This is a fourth level heading.
+
+
+
+
+
+
+
+
This is a fifth level heading.
+
+
+
+
+
+
+
+
+
+
This is a sixth level heading.
+
+
+
+
+
+
+
+
+
+
+
This is a seventh level heading.
+
+
+
+
+
diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/002-htmlTable.docbook.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/002-htmlTable.docbook.xml index 3875abf8..dd7e20a2 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/002-htmlTable.docbook.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/002-htmlTable.docbook.xml @@ -5,21 +5,41 @@ xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0">
11 + 12
+
21 + 22
+ + tableTitle + Table caption. + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/004-tableTitles.docbook.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/004-tableTitles.docbook.xml index 3f8d9c2c..e09af903 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/004-tableTitles.docbook.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/004-tableTitles.docbook.xml @@ -8,6 +8,9 @@ Heading 2Heading 3 + + summary1 +
Table caption.
+ + top + XSLT + col + 11 + + middle + XSD + row + 12
+ + bottom + 21 + + baseline + 22
@@ -16,6 +19,9 @@ Heading 3 Heading 3 + + summary2 +
diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/108-expandTable.docbook.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/108-expandTable.docbook.xml index 3f8d9c2c..e09af903 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/108-expandTable.docbook.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/ezxml/lossy/108-expandTable.docbook.xml @@ -8,6 +8,9 @@ Heading 2 Heading 3 + + summary1 +
@@ -16,6 +19,9 @@ Heading 3 Heading 3 + + summary2 +
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/083-header-nested.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/083-header-nested.xml index 6782bab8..69246821 100644 --- a/tests/lib/FieldType/Converter/_fixtures/richtext/output/083-header-nested.xml +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/083-header-nested.xml @@ -1,6 +1,9 @@
+ + some caption + @@ -11,6 +14,9 @@
some caption
+ + some caption + @@ -25,6 +31,9 @@
some caption
+ + some caption + diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/090-table.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/090-table.xml index 6782c344..850408ea 100644 --- a/tests/lib/FieldType/Converter/_fixtures/richtext/output/090-table.xml +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/090-table.xml @@ -6,6 +6,10 @@ xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> some table
some caption
+ + custom summary + custom caption + diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/143-paragraph-temporary-table-oe.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/143-paragraph-temporary-table-oe.xml index d2cfba8a..ef06329d 100644 --- a/tests/lib/FieldType/Converter/_fixtures/richtext/output/143-paragraph-temporary-table-oe.xml +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/143-paragraph-temporary-table-oe.xml @@ -1,6 +1,10 @@
custom caption
+ + test table summary + my caption + @@ -40,6 +44,10 @@
my caption
Header 1 + + summary2 + caption2 + diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/144-paragraph-temporary-table-simplifiedxml.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/144-paragraph-temporary-table-simplifiedxml.xml index d2cfba8a..ef06329d 100644 --- a/tests/lib/FieldType/Converter/_fixtures/richtext/output/144-paragraph-temporary-table-simplifiedxml.xml +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/144-paragraph-temporary-table-simplifiedxml.xml @@ -1,6 +1,10 @@
caption2
+ + test table summary + my caption + @@ -40,6 +44,10 @@
my caption
Header 1 + + summary2 + caption2 + diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/150-literal.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/150-literal.xml index 2082d0d6..ad72905d 100644 --- a/tests/lib/FieldType/Converter/_fixtures/richtext/output/150-literal.xml +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/150-literal.xml @@ -12,7 +12,7 @@ return 0; }]]>the php one with language attribute: - function foobar() + phpfunction foobar() { thisIsSomePHPCode(); return 0; From d57ec15e76a8b2e572cfceca19d293aaf9f60c93 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Fri, 26 Apr 2019 08:45:42 -0400 Subject: [PATCH 5/8] Custom attributes: require richtext, use richtext Validator, update tests --- composer.json | 3 ++- lib/FieldType/XmlText/Converter/RichText.php | 2 +- tests/lib/FieldType/Converter/EzxmlToDocbookTest.php | 6 +++--- tests/lib/FieldType/Converter/RichTextTest.php | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index eae04f6c..8dd704e6 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ ], "require": { "ezsystems/ezpublish-kernel": "^6.13.6@dev || ^7.2.5@dev", - "ezsystems/repository-forms": "^1.9 || ^2.0" + "ezsystems/repository-forms": "^1.9 || ^2.0", + "ezsystems/ezplatform-richtext": "^1.1" }, "require-dev": { "phpunit/phpunit": "^5.7", diff --git a/lib/FieldType/XmlText/Converter/RichText.php b/lib/FieldType/XmlText/Converter/RichText.php index 25da64e3..f6e975d8 100644 --- a/lib/FieldType/XmlText/Converter/RichText.php +++ b/lib/FieldType/XmlText/Converter/RichText.php @@ -16,12 +16,12 @@ use Psr\Log\LoggerInterface; use eZ\Publish\Core\FieldType\RichText\Converter\Aggregate; use eZ\Publish\Core\FieldType\RichText\Converter\Xslt; -use eZ\Publish\Core\FieldType\RichText\Validator; use eZ\Publish\Core\Base\Exceptions\NotFoundException; use Psr\Log\NullLogger; use Psr\Log\LogLevel; use Symfony\Component\Debug\Exception\ContextErrorException; use eZ\Publish\API\Repository\Repository; +use EzSystems\EzPlatformRichText\eZ\RichText\Validator\Validator; class RichText implements Converter { diff --git a/tests/lib/FieldType/Converter/EzxmlToDocbookTest.php b/tests/lib/FieldType/Converter/EzxmlToDocbookTest.php index c733b4e3..65c91cd2 100644 --- a/tests/lib/FieldType/Converter/EzxmlToDocbookTest.php +++ b/tests/lib/FieldType/Converter/EzxmlToDocbookTest.php @@ -8,7 +8,7 @@ */ namespace EzSystems\EzPlatformXmlTextFieldType\Tests\FieldType\Converter; -use eZ\Publish\Core\FieldType\RichText\Validator; +use EzSystems\EzPlatformRichText\eZ\RichText\Validator\Validator; use eZ\Publish\Core\FieldType\XmlText\Converter\RichText; use eZ\Publish\Core\SignalSlot\Repository; use eZ\Publish\API\Repository\ContentService; @@ -58,8 +58,8 @@ private function createApiRepositoryStub() protected function getConverter($inputFile) { $validatorSchemas = [ - './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/schemas/docbook/ezpublish.rng', - './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/schemas/docbook/docbook.iso.sch.xsl', + './vendor/ezsystems/ezplatform-richtext/src/lib/eZ/RichText/Resources/schemas/docbook/ezpublish.rng', + './vendor/ezsystems/ezplatform-richtext/src/lib/eZ/RichText/Resources/schemas/docbook/docbook.iso.sch.xsl', ]; $apiRepositoryStub = $this->createApiRepositoryStub(); diff --git a/tests/lib/FieldType/Converter/RichTextTest.php b/tests/lib/FieldType/Converter/RichTextTest.php index 7d6433dd..313795e0 100644 --- a/tests/lib/FieldType/Converter/RichTextTest.php +++ b/tests/lib/FieldType/Converter/RichTextTest.php @@ -19,7 +19,7 @@ use eZ\Publish\API\Repository\Values\Content\Location; use Psr\Log\NullLogger; use eZ\Publish\Core\Base\Exceptions\NotFoundException; -use eZ\Publish\Core\FieldType\RichText\Validator; +use EzSystems\EzPlatformRichText\eZ\RichText\Validator\Validator; class RichTextTest extends TestCase { @@ -258,8 +258,8 @@ public function getValidator() { return new Validator( array( - './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/schemas/docbook/ezpublish.rng', - './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/schemas/docbook/docbook.iso.sch.xsl', + './vendor/ezsystems/ezplatform-richtext/src/lib/eZ/RichText/Resources/schemas/docbook/ezpublish.rng', + './vendor/ezsystems/ezplatform-richtext/src/lib/eZ/RichText/Resources/schemas/docbook/docbook.iso.sch.xsl', ) ); } From b04817a10c7f4e36e13e81e76a802d115e7e9568 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Tue, 30 Apr 2019 10:01:43 +0100 Subject: [PATCH 6/8] Custom attributes: removing travis configs for PHP <7.1 --- .travis.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 38147953..370e4a64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,24 +14,14 @@ addons: matrix: include: - - php: 5.6 - env: TEST_CONFIG="phpunit.xml" - - php: 7.0 - env: TEST_CONFIG="phpunit.xml" - php: 7.2 env: TEST_CONFIG="phpunit.xml" CHECK_CS=true - - php: 7.0 - env: TEST_CONFIG="phpunit-integration-legacy.xml" - - php: 5.6 - env: TEST_CONFIG="phpunit-integration-legacy-solr.xml" SOLR_VERSION="4.10.4" CORES_SETUP="single" SOLR_CORES="collection1" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" - php: 7.1 env: TEST_CONFIG="phpunit-integration-legacy-solr.xml" SOLR_VERSION="6.6.0" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" - php: 7.1 env: TEST_CONFIG="phpunit-integration-legacy-empty-db.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb" - php: 7.1 env: TEST_CONFIG="phpunit-integration-legacy-empty-db.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb" - - php: 7.0 - env: TEST_CONFIG="phpunit.xml" COMPOSER_REQUIRE="ezsystems/ezpublish-kernel:^6.13.6@dev" # test only master (+ Pull requests) branches: From 6a2607f06c783a26e62b14c0ed66253e0e46c287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Tue, 30 Apr 2019 12:45:30 +0200 Subject: [PATCH 7/8] [Travis] Add full PHP 7.x testing --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 370e4a64..9a2a1621 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,13 +14,17 @@ addons: matrix: include: + - php: 7.1 + env: TEST_CONFIG="phpunit.xml" - php: 7.2 env: TEST_CONFIG="phpunit.xml" CHECK_CS=true + - php: 7.3 + env: TEST_CONFIG="phpunit.xml" - php: 7.1 env: TEST_CONFIG="phpunit-integration-legacy-solr.xml" SOLR_VERSION="6.6.0" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" - - php: 7.1 + - php: 7.2 env: TEST_CONFIG="phpunit-integration-legacy-empty-db.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb" - - php: 7.1 + - php: 7.3 env: TEST_CONFIG="phpunit-integration-legacy-empty-db.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb" # test only master (+ Pull requests) From 21f0ad92792c8ea2ddcdceddf060f1ca765d70b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Tue, 30 Apr 2019 12:46:01 +0200 Subject: [PATCH 8/8] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9a2a1621..265ca2e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: - php: 7.3 env: TEST_CONFIG="phpunit.xml" - php: 7.1 - env: TEST_CONFIG="phpunit-integration-legacy-solr.xml" SOLR_VERSION="6.6.0" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" + env: TEST_CONFIG="phpunit-integration-legacy-solr.xml" SOLR_VERSION="6.6.5" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" - php: 7.2 env: TEST_CONFIG="phpunit-integration-legacy-empty-db.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb" - php: 7.3
caption2