|
31 | 31 |
|
32 | 32 | it "processes annexes and appendixes" do
|
33 | 33 | input = <<~INPUT
|
34 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml"> |
| 34 | + <metanorma xmlns="http://riboseinc.com/isoxml"> |
35 | 35 | <bibdata type="standard">
|
36 | 36 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
37 | 37 | <docidentifier type="ITU">12345</docidentifier>
|
|
69 | 69 | <annex id="B10" obligation="informative"><title>Annex</title></annex>
|
70 | 70 | INPUT
|
71 | 71 | presxml = <<~OUTPUT
|
72 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml" type="presentation"> |
| 72 | + <metanorma xmlns="http://riboseinc.com/isoxml" type="presentation"> |
73 | 73 | <bibdata type="standard">
|
74 | 74 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
75 | 75 | <docidentifier type="ITU">12345</docidentifier>
|
|
638 | 638 | <span class="fmt-obligation">(This appendix does not form an integral part of this Recommendation.)</span>
|
639 | 639 | </p>
|
640 | 640 | </annex>
|
641 |
| - </itu-standard> |
| 641 | + </metanorma> |
642 | 642 | OUTPUT
|
643 | 643 | html = <<~OUTPUT
|
644 | 644 | #{HTML_HDR}
|
|
765 | 765 |
|
766 | 766 | it "processes section names" do
|
767 | 767 | presxml = <<~OUTPUT
|
768 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml" type="presentation"> |
| 768 | + <metanorma xmlns="http://riboseinc.com/isoxml" type="presentation"> |
769 | 769 | <bibdata type="standard">
|
770 | 770 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
771 | 771 | <title language="fr" format="text/plain" type="main">Un Standard ITU</title>
|
|
1071 | 1071 | </references>
|
1072 | 1072 | </clause>
|
1073 | 1073 | </bibliography>
|
1074 |
| - </itu-standard> |
| 1074 | + </metanorma> |
1075 | 1075 | OUTPUT
|
1076 | 1076 |
|
1077 | 1077 | html = <<~OUTPUT
|
|
1309 | 1309 | it "post-processes section names (Word)" do
|
1310 | 1310 | FileUtils.rm_f "test.doc"
|
1311 | 1311 | IsoDoc::Itu::WordConvert.new({}).convert("test", <<~INPUT, false)
|
1312 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml"> |
| 1312 | + <metanorma xmlns="http://riboseinc.com/isoxml"> |
1313 | 1313 | <bibdata type="standard">
|
1314 | 1314 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
1315 | 1315 | <docidentifier type="ITU">12345</docidentifier>
|
|
1353 | 1353 | </clause>
|
1354 | 1354 | </clause>
|
1355 | 1355 | </annex>
|
1356 |
| - </itu-standard> |
| 1356 | + </metanorma> |
1357 | 1357 | INPUT
|
1358 | 1358 | expect(File.exist?("test.doc")).to be true
|
1359 | 1359 | html = File.read("test.doc", encoding: "UTF-8")
|
|
1404 | 1404 | FileUtils.rm_f "test.html"
|
1405 | 1405 | FileUtils.rm_f "test.doc"
|
1406 | 1406 | input = <<~INPUT
|
1407 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml"> |
| 1407 | + <metanorma xmlns="http://riboseinc.com/isoxml"> |
1408 | 1408 | <bibdata type="standard">
|
1409 | 1409 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
1410 | 1410 | <title language="en" format="text/plain" type="subtitle">Subtitle</title>
|
|
1428 | 1428 | <formula id="V"><stem type="AsciiMath">r = 1 %</stem></formula>
|
1429 | 1429 | </clause>
|
1430 | 1430 | </annex>
|
1431 |
| - </itu-standard> |
| 1431 | + </metanorma> |
1432 | 1432 | INPUT
|
1433 | 1433 |
|
1434 | 1434 | presxml = <<~OUTPUT
|
1435 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml" type="presentation"> |
| 1435 | + <metanorma xmlns="http://riboseinc.com/isoxml" type="presentation"> |
1436 | 1436 | <bibdata type="standard">
|
1437 | 1437 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
1438 | 1438 | <title language="en" format="text/plain" type="subtitle">Subtitle</title>
|
|
1563 | 1563 | </formula>
|
1564 | 1564 | </clause>
|
1565 | 1565 | </annex>
|
1566 |
| - </itu-standard> |
| 1566 | + </metanorma> |
1567 | 1567 | OUTPUT
|
1568 | 1568 | pres_output = IsoDoc::Itu::PresentationXMLConvert
|
1569 | 1569 | .new(presxml_options)
|
|
1741 | 1741 |
|
1742 | 1742 | it "processes unnumbered clauses" do
|
1743 | 1743 | input = <<~INPUT
|
1744 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml"> |
| 1744 | + <metanorma xmlns="http://riboseinc.com/isoxml"> |
1745 | 1745 | <bibdata type="standard">
|
1746 | 1746 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
1747 | 1747 | <title language="en" format="text/plain" type="subtitle">Subtitle</title>
|
|
1758 | 1758 | <clause unnumbered="true" id="A"><p>Text</p></clause>
|
1759 | 1759 | <clause id="B"><title>First Clause</title></clause>
|
1760 | 1760 | </sections>
|
1761 |
| - </itu-standard> |
| 1761 | + </metanorma> |
1762 | 1762 | INPUT
|
1763 | 1763 | presxml = <<~OUTPUT
|
1764 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml" type="presentation"> |
| 1764 | + <metanorma xmlns="http://riboseinc.com/isoxml" type="presentation"> |
1765 | 1765 | <bibdata type="standard">
|
1766 | 1766 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
1767 | 1767 | <title language="en" format="text/plain" type="resolution">RESOLUTION (, )</title>
|
|
1798 | 1798 | </fmt-title>
|
1799 | 1799 | </clause>
|
1800 | 1800 | </sections>
|
1801 |
| - </itu-standard> |
| 1801 | + </metanorma> |
1802 | 1802 | OUTPUT
|
1803 | 1803 | expect(Xml::C14n.format(strip_guid(IsoDoc::Itu::PresentationXMLConvert.new(presxml_options)
|
1804 | 1804 | .convert("test", input, true)
|
|
1808 | 1808 |
|
1809 | 1809 | it "processes bis, ter etc clauses" do
|
1810 | 1810 | input = <<~INPUT
|
1811 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml"> |
| 1811 | + <metanorma xmlns="http://riboseinc.com/isoxml"> |
1812 | 1812 | <bibdata type="standard">
|
1813 | 1813 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
1814 | 1814 | <title language="en" format="text/plain" type="subtitle">Subtitle</title>
|
|
1831 | 1831 | </clause>
|
1832 | 1832 | <clause id="E" number="10bit"><title>Non-Clause</title></clause>
|
1833 | 1833 | </sections>
|
1834 |
| - </itu-standard> |
| 1834 | + </metanorma> |
1835 | 1835 | INPUT
|
1836 | 1836 | presxml = <<~OUTPUT
|
1837 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml" type="presentation"> |
| 1837 | + <metanorma xmlns="http://riboseinc.com/isoxml" type="presentation"> |
1838 | 1838 | <bibdata type="standard">
|
1839 | 1839 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
1840 | 1840 | <title language="en" format="text/plain" type="resolution">RESOLUTION (, )</title>
|
|
1966 | 1966 | </fmt-title>
|
1967 | 1967 | </clause>
|
1968 | 1968 | </sections>
|
1969 |
| - </itu-standard> |
| 1969 | + </metanorma> |
1970 | 1970 | OUTPUT
|
1971 | 1971 | expect(Xml::C14n.format(strip_guid(IsoDoc::Itu::PresentationXMLConvert.new(presxml_options)
|
1972 | 1972 | .convert("test", input, true)
|
|
1976 | 1976 |
|
1977 | 1977 | it "processes editor clauses, one editor" do
|
1978 | 1978 | input = <<~INPUT
|
1979 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml"> |
| 1979 | + <metanorma xmlns="http://riboseinc.com/isoxml"> |
1980 | 1980 | <bibdata type="standard">
|
1981 | 1981 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
1982 | 1982 | <title language="en" format="text/plain" type="subtitle">Subtitle</title>
|
|
2003 | 2003 | <sections>
|
2004 | 2004 | <clause id="A"/>
|
2005 | 2005 | </sections>
|
2006 |
| - </itu-standard> |
| 2006 | + </metanorma> |
2007 | 2007 | INPUT
|
2008 | 2008 | presxml = <<~OUTPUT
|
2009 | 2009 | <preface>
|
|
2039 | 2039 |
|
2040 | 2040 | it "processes editor clauses, two editors" do
|
2041 | 2041 | input = <<~INPUT
|
2042 |
| - <itu-standard xmlns="http://riboseinc.com/isoxml"> |
| 2042 | + <metanorma xmlns="http://riboseinc.com/isoxml"> |
2043 | 2043 | <bibdata type="standard">
|
2044 | 2044 | <title language="en" format="text/plain" type="main">An ITU Standard</title>
|
2045 | 2045 | <title language="en" format="text/plain" type="subtitle">Subtitle</title>
|
|
2064 | 2064 | <sections>
|
2065 | 2065 | <clause id="A"><p/></clause>
|
2066 | 2066 | </sections>
|
2067 |
| - </itu-standard> |
| 2067 | + </metanorma> |
2068 | 2068 | INPUT
|
2069 | 2069 | presxml = <<~OUTPUT
|
2070 | 2070 | <preface>
|
|
2106 | 2106 | "html"),
|
2107 | 2107 | )
|
2108 | 2108 | input = <<~INPUT
|
2109 |
| - <itu-standard xmlns='https://www.metanorma.org/ns/itu' type='semantic'> |
| 2109 | + <metanorma xmlns='https://www.metanorma.org/ns/itu' type='semantic'> |
2110 | 2110 | <bibdata type='standard'>
|
2111 | 2111 | <title language='en' format='text/plain' type='main'>Main Title</title>
|
2112 | 2112 | <title language='fr' format='text/plain' type='main'>Titre Principal</title>
|
|
2271 | 2271 | <p id="_a42297b2-5f04-5da9-64c2-7e92670d5cad">TEXT 9</p>
|
2272 | 2272 | </clause>
|
2273 | 2273 | </annex>
|
2274 |
| - </itu-standard> |
| 2274 | + </metanorma> |
2275 | 2275 | INPUT
|
2276 | 2276 | presxml = <<~OUTPUT
|
2277 |
| - <itu-standard> |
| 2277 | + <metanorma> |
2278 | 2278 | <preface>
|
2279 | 2279 | <clause unnumbered="true" type="contribution-metadata" displayorder="1">
|
2280 | 2280 | <table class="contribution-metadata" unnumbered="true" width="100%">
|
|
2564 | 2564 | </tbody>
|
2565 | 2565 | </table>
|
2566 | 2566 | </annex>
|
2567 |
| - </itu-standard> |
| 2567 | + </metanorma> |
2568 | 2568 | OUTPUT
|
2569 | 2569 |
|
2570 | 2570 | xml = Nokogiri::XML(IsoDoc::Itu::PresentationXMLConvert.new(presxml_options)
|
2571 | 2571 | .convert("test", input, true))
|
2572 | 2572 | xml = xml.xpath("//xmlns:preface | //xmlns:sections | //xmlns:annex").to_xml
|
2573 |
| - expect(Xml::C14n.format(strip_guid("<itu-standard>#{xml}</itu-standard>"))) |
| 2573 | + expect(Xml::C14n.format(strip_guid("<metanorma>#{xml}</itu-standard>"))) |
2574 | 2574 | .to be_equivalent_to Xml::C14n.format(presxml)
|
2575 | 2575 |
|
2576 | 2576 | presxml = <<~OUTPUT
|
|
0 commit comments