Project

Profile

Help

Revision c1cc9bd8

Added by O'Neil Delpratt 5 months ago

Saxon/C bug fix to #4848 and #4847. Also some development work

View differences:

latest10/hec/samples/php/xslt30_PHPUnit.php
193 193

  
194 194
    }
195 195

  
196
    public function testTransformWithoutArgument1(): void
197
    {
198

  
199
        $transformer = self::$saxonProc->newXslt30Processor();
200

  
201

  
202
        $foo_xml = "trax/xml/foo.xml";
203
        $transformer->compileFromAssociatedFile($foo_xml);
204
        $transformer->setInitialMatchSelectionAsFile($foo_xml);
205
        $result = $transformer->transformToString();
206

  
207
        $this->assertNotNull($result);
208

  
209
    }
210

  
211
    public function testTransformWithoutArgument2(): void
212
    {
213

  
214
        $transformer = self::$saxonProc->newXslt30Processor();
215

  
216

  
217
        $foo_xml = "trax/xml/foo.xml";
218
        $transformer->compileFromAssociatedFile($foo_xml);
219
        $transformer->setInitialMatchSelectionAsFile($foo_xml);
220
        $resultValue = $transformer->transformToValue();
221
        $this->assertNotNull($resultValue);
222
        $resultItem = $resultValue->getHead();
223
        $this->assertNotNull($resultItem);
224
        $result = $resultItem->getStringValue();
225
        $this->assertNotNull($result);
226

  
227
    }
228

  
229

  
230

  
231
    public function testTransformWithoutArgument3(): void
232
    {
233

  
234
        $transformer = self::$saxonProc->newXslt30Processor();
235

  
236

  
237
        $foo_xml = "trax/xml/foo.xml";
238
        $transformer->compileFromAssociatedFile($foo_xml);
239
        $transformer->setInitialMatchSelectionAsFile($foo_xml);
240
        $transformer->setOutputFile("resultForTransformWithoutArgument.xml");
241
        $transformer->transformToFile();
242
        $this->assertTrue(file_exists("resultForTransformWithoutArgument.xml"));
243

  
244
                if (file_exists("resultForTransformWithoutArgument.xml")) {
245
                    unlink("resultForTransformWithoutArgument.xml");
246
                }
247

  
248
    }
249

  
196 250

  
197 251
    public function testNullStylesheet(): void
198 252
    {

Also available in: Unified diff